1.7 Directories Flashcards
What is the shortcut to move directly to the home directory when using the cd command?
”~”
What is the difference in function between the rm command and the rmdir command?
The rmdir comand removes empty directories only. The rm command removes file and directory inodes without deleting the data.
What are the two different kinds of paths?
- Absolute
- Relative
Which symbols represent the current and parent directory?
- Current: .
- Parent: ..
Which symbol represents the user’s home directory?
”~”
Which command creates a blank, empty file?
touch
What does the pwd command do?
Displays the present working directory.
What does the cd command do?
Changes the present working directory.
What does the ls command do?
Displays the contents of a directory. Options include:
What does the ls -a command do?
ls -a displays all directory contents, including hidden content.
What does the ls -l command do?
ls -l displays a long listing for directory contents, including the owner, modified date, size, and permissions.
What does the ls -R command do?
ls -R displays the contents of the directory and all sub-directories.
What does the ls -d command do?
ls -d displays directories but not files.
What does the ls -r command do?
ls -r displays the contents of a directory, reversing the sort order.
What does the mkdir command do?
Creates a new directory
What does the mkdir -p command do?
Creates a new directory and creates any intermediate directories that do not exist.
What does the cp command do?
Copies files, leaving originals unchanged.
What does the cp -R (or cp -r) command do?
Copies files or copies directories recursively (the directory and everything in it)
What does the mv command do?
Moves or renames files and directories. Moving directories erases the source directory and places it in the destination.
What does the mv -f command do?
Moves or renames files and directories, overwriting files and directories that exist in the destination directory.
What does the mv -i command do?
Moves or renames files and directories, prompting before overwriting files and directories in the destionation directory.
What does the mv -n command do?
Moves or renames files and directories, never overwriting files and directories in the destionation directory.
What does the rmdir command do?
Deletes an empty directory.
What does the rm command do?
Removes file and directory inodes, but does not actually delete the data.
What does the rm -r command do?
Removes file and directory inodes. For directories, recursively deletes the directory and everything in it.
What does the rm -f command do?
Removes file and directory inodes without prompting for confirmation.