Review Flashcards
“absolute path”
A path the is fully specified from the root directory down.
“relative path”
A path that is relative to the current working directory.
/
The root directory OR the character to separate directories in a path.
“home directory”
The directory where that user’s files typically reside.
pwd
The command that prints the shell’s current working directory
ls
The command that prints the contents (files and directories) in the current working directory.
ls «directorypath»
The command that prints the contents of the named directory.
ls -a
The command to print directory contents including hidden files
ls -l
The command to print directory contents in a long, more descriptive format
.
The hidden directory that refers to the directory itself.
..
The hidden directory that refers to a directory’s parent directory.
man «command»
The command “manual page” for a given command
mkdir «directorypath»
The command to create a new directory.
cd «directorypath»
The command to change the current working directory to «pathname»
~
The user’s home directory
cp «fromfilepath» «tofilepath»
The command to make a copy of «fromfile» as «tofile»
cp «fromfilepath» «directorypath»
The command to make a copy of a file in another directory
mv «fromfilepath» «tofilepath»
The command to rename (and possibly move) «fromfilepath» as «tofilepath»
mv «fromfilepath» «directorypath»
The command to move a file to another directory
rm «filepath»
The command to delete file(s).
rm -r «directorypath»
The command to delete a directory and all its contents.
rmdir «directorypath»
The command to delete an empty directory
cat «filepath»
The command to print the contents of the named file
head «filepath»
The command to print the first 10 lines of the named file
tail «filepath»
The command to print the last 10 lines of the named file
more «filepath»
The command to print the named file, one screen at a time.
grep «word» «filepath»
Print the lines in a file that contain «word»
wc «filepath»
Print the number of lines, words, and characters in the named file.
echo «command line»
Print the «command line»
sort -n «filepath»
Print the lines of the file sorted in numeric order
sort «filepath»
Print the lines of the file sorted in alphabetical order
“current working directory”
The directory the shell uses as a reference point for relative paths.
ls «dirpath»
The command that prints the contents of the named directory, «dirpath».
mkdir «dirpath»
The command to create a new directory, «dirpath»
cd «dirpath»
The command to change the current working directory to «dirpath»
cp «frompath» «topath»
The command to make a copy of «frompath» as «topath»
cp «frompath» «dirpath»
The command to make a copy of a file, «frompath», in another directory, «dirpath»
mv «frompath» «topath»
The command to rename (and possibly move) «frompath» as «topath»
mv «frompath» «dirpath»
The command to move a file, «frompath», to another directory, «dirpath»
rm -r «dirpath»
The command to delete a directory, «dirpath», and all its contents.
«command» > «topath»
The redirection that causes the stdout of «command» to be stored in the file «topath»
«command» < «frompath»
The redirection that causes the stdin of «command» to come from the file «frompath»
«command»»_space; «topath»
The redirection that causes the stdout of «command» to be appended to the file «topath»
«fromcommand» | «tocommand»
The redirection that causes the stdout of «command» to be the stdin of the command «tocommand»
“stdin”
The name of the input stream
“stdout”
The name of the output stream
“stderr”
The name of the error stream
char x;
How to declare variable x as a character.
int x;
How to declare variable x as an integer.
char *p;
How to declare variable p as a pointer to a character.
int *p;
How to declare variable p as a pointer to an integer.
int z[10];
How to declare variable z as an array of 10 integers.
char z[10];
How to declare variable z as an array of 10 characters.
*p
How to dereference the pointer p, to refer to the value held at the address held in p.