1/89
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Echo command to find current shell?
echo $SHELL or echo $0
Command to append output to existing file?
>> (Example: ls >> file.txt)
Command that displays your username?
whoami
ls command to list all files including hidden?
ls -a
Pathname starting with slash is called?
Absolute pathname
True/False: Relative pathname begins with slash
FALSE
What does cd with no arguments do?
Changes to home directory
Unix file system structure type?
Hierarchical or tree-like
Default directory when you log in?
Home directory
Directory navigation - what is dot?
Current directory
Directory navigation - what is dot-dot?
Parent directory (up one level)
Command for help about other commands?
man (manual pages)
Hidden files start with what symbol?
Dot (.)
Echo command to display shell name?
echo $0
Valid syntax for man pipe to less?
man ls | less
How to display value of variable TOTAL?
echo $TOTAL
What does echo $PATH display?
Colon-separated list of executable directories
ls option to display permissions?
ls -l
Program not in search path result?
command not found error
Command to change file permissions?
chmod
Commands to change to home directory?
cd, cd ~, cd $HOME
Command to copy a file?
cp
Command for file type/classification?
file
Display text one screen at a time?
less or more
Find files by name in directory tree?
find
Link command syntax?
ln source_file link_name
Output text file contents?
cat
Search patterns in file?
grep
List files/subdirectories recursively?
ls -R
Create new directory?
mkdir
Rename or move file?
mv
Display logged-in users?
who or w
Remove non-empty directory?
rm -r directory_name
Delete a file?
rm
True/False: touch creates file if doesn't exist
TRUE
Script PID variable?
$$
All command-line arguments variable?
$* or $@
Number of arguments variable?
$#
Script name variable?
$0
Create shell variable syntax?
VARNAME="value" (no spaces)
Variable initialization syntax?
VARNAME="value" (no spaces around =)
Echo pipe to more does what?
Paginates output
Single vs double quotes difference?
Double allows variables, single literal
Read input command first method?
read variablename
Read input command?
read
$HOME contains?
Absolute pathname of home directory
find -name option purpose?
Search by filename
List only hidden files?
ls -d .*
Metacharacter for zero or more?
* (asterisk)
Metacharacter for exactly one?
? (question mark)
Pipe metacharacter?
| (vertical bar)
Exit Vim insert mode?
ESC
Enter Vim insert mode?
i, a, or o
Vim startup mode?
Native/Command Mode
Enter Vim command-line mode?
: (colon)
Vim save and quit?
:wq
Vim delete current line?
dd
True/False: Vim only opens existing files
FALSE
Display directory and hidden files?
ls -a
True/False: Symbolic links only to files
FALSE (directories too)
Owner execute in ls -l position?
Position 4
How to read ls -l output?
Positions 2-4 owner, 5-7 group, 8-10 others
Group name in ls -l?
Fourth field
Group permissions positions?
Positions 5-7
Others execute position?
Position 10
chmod 755 result?
rwxr-xr-x
Understanding chmod changes?
755=rwxr-xr-x, 644=rw-r--r--
True/False: User can chmod own files
TRUE
True/False: Only owner can view permissions
FALSE
True/False: Root can modify any permissions
TRUE
rmdir removes what?
Empty directories only
True/False: touch resets permissions
FALSE (updates timestamps)
Non-blank character sequence called?
Token or word
True/False: Bash options start with dash
TRUE
True/False: pwd has zero arguments
TRUE
True/False: echo is built-in
TRUE
Redirect ls -l to file?
ls -l > ls-out
Shebang line for bash?
#!/bin/bash
Run script in current directory?
./scriptname
Run function my_func?
Type: my_func
Alias command syntax?
alias name="command"
grep vs cat output?
grep shows matching lines, cat shows all
Startup configuration file?
.bashrc or .bash_profile
True/False: echo $HOME works (uppercase)?
TRUE (case-sensitive)
True/False: Symbolic links only to files (2nd Q)
FALSE
True/False: Only owner changes permissions
FALSE (root can too)
True/False: Script variables global by default
TRUE
Define function named test?
test() { commands; }
Functions persist between sessions?
FALSE
Export command purpose?
Makes variables available to sub-processes