Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
70 Cards in this Set
- Front
- Back
What is the difference between ‘single quotes’ and “double quotes”? |
‘single quotes’ are strong quotes and will not allow expansion of variables.“double quotes” are weak quotes and will allow expansion of variables.Ex: If you have a variable var=123echo ‘$var’ will not return the value of that variable.echo “$var” will return the value of that variable (123). |
|
Command: ^s |
What it does: halt output to screen |
|
Command: ^d |
What it does: end of input |
|
Command:^c |
What it does: stop current command |
|
Command:^q |
What it does: restart output to screen |
|
Command:^/ |
What it does: stop current command |
|
Wildcard: ? |
any single character |
|
Wildcard: * |
any string of characters |
|
Wildcard: [set] |
any character in set |
|
Wildcard: [!set] |
any character not in set |
|
What is PATH? |
An environmental variable that tells SHELL which directory to search for exe files |
|
Describe what #! does. (known as interpreter) |
The shebang is a directive to the loader to use the program that’s specified after it and tells Linux what program to run |
|
/bin |
binaries (executables) |
|
/sbin |
System binaries |
|
/libexec |
/lib/ is essential shared libraries, /libexec is for binary system executables |
|
/etc |
System configuration |
|
/var |
variables (logs, files that support services/programs) |
|
/tmp |
temporary |
|
Command |
What it does? |
|
which |
path a utility is located |
|
ls |
list all files and directories except hidden ones |
|
echo |
prints to stdout |
|
man |
manual pages |
|
cd |
change directory |
|
cat |
prints to stdout |
|
whereis |
Locates binary, source, and manual pages for a file |
|
touch |
create file, if file exist then it will update the timestamps |
|
umask |
Masks the permissions, takes them away |
|
chmod |
change permission of file or directory |
|
mkdir |
create directory |
|
rmdir |
remove directory |
|
rm |
remove file |
|
test |
check file types and compare values |
|
export |
Creative environmental variables |
|
read |
input from stdin |
|
builtin |
test if it is built in command |
|
test -e “filename” |
check if the file exists |
|
test -f “filename” |
checks if the file is the regular file |
|
test -d “filename” |
checks if the file is a directory |
|
test -c “filename” |
checks if the file exists and is character special |
|
test -b “filename” |
checks if the file exists and is block special |
|
test -r “filename” |
checks if the file is readable |
|
test -w “filename” |
checks if the file can be written by the user |
|
test -x “filename” |
checks if the file can be executed |
|
test -z “filename” |
checks if the length of string is zero |
|
test -n “filename” |
checks if the length of string is nonzero |
|
ls -a |
list all files including hidden |
|
ls -l |
display result in long format |
|
ls -d |
use in conjunction with the -l option to see details about the dir rather than its contents |
|
ls -r |
display results in reverse order |
|
ls -S |
sort results by file size |
|
ls -t |
sort by modification time |
|
ls -n |
sort by numerical order |
|
echo $? |
checks if the command ran properly |
|
What is piping? |
output of 1st command is inputted into 2nd command |
|
What is the difference between curly brackets { }, square brackets [ ] , parentheses ( ) , and double parentheses (( )) |
curly brackets { } string extension square brackets [ ] conditional string parentheses ( ) used for subshells double parentheses (( )) for integer expression |
|
-eq |
equal |
|
-ne |
not equal |
|
-lt |
less than |
|
-le |
less than or equal |
|
-gt |
greater than |
|
-ge |
greater than or equal |
|
${varname:-word} |
If varname exists and isn’t null, return its value; otherwise return word |
|
${varname:=word} |
If varname exists and isn’t null, return its value; otherwise set it to word and then return it’s value |
|
${varname:?message} |
If varname exists and isn’t null, return its value; otherwise print varname; followed by message, and abort current command or script |
|
${varname:offset:length} |
Performs substring expansion. It returns the substring of $varname starting at offset and up to length characters. The first character in $varname is position 0 |
|
${varname#pattern} |
If the pattern matches the beginning of the variable’s value, delete the shortest part that matches and return the rest |
|
${varname##pattern} |
If the pattern matches the beginning of the variable’s value, delete the longest part that matches and return the rest |
|
${varname%pattern} |
If the pattern matches the end of the variable’s value, delete the shortest part that matches and return the rest |
|
${varname%%pattern} |
If the pattern matches the end of the variable’s value, delete the longest part that matches and return the rest |