bash shell commands Flashcards
Learn all of the bash shell commands.
What is the command to search the man pages using keywords?
man -k
What is the cd command used for?
Change the working directory. cd
Where does cd with no destination take you?
home directory.
When using cd, what does an absolute directory reference always begin with?
/
What does the pwd command do?
Displays the current working directory. (present working directory)
what does . represent when using cd?
The current directory.
What does .. represent when using cd?
The parent directory.
Where doe “cd -“ take you?
The previous working directory.
What is the ls command used for?
List the contents of a directory.
What does -F do in the ls command?
Puts a forward slash at the end of each directory and an * at the end of each executable in the current directory.
What does ls -a do?
Includes directory entries whose names begin with a dot (.).
What does ls -R do?
Recursively lists subdirectories encountered.
What does ls -l do?
List in long format. If the output is to a terminal, a total sum for all the file sizes is output on a line before the long listing.
What is the ? used for in the ls command?
A metacharacter wildcard character to represent one character in a pattern for text matching.
What is the * used for in the ls command?
A metacharacter wildcard character to represent any number of characters in a pattern for text matching.
What is file globbing?
The process of pattern matching using wildcards.
What are [] used for in the ls command?
Metacharacter wildcards that represent a single position and give you multiple options for file globbing.
What does the touch command do?
Sets the modification and access times of files. If any file does not exist, it is created with default permissions.
What does the cp command do?
Copies the contents of the source_file to the target_file or the contents of each named source_file is copied to the destination target_directory.
What does a trailing / when used with the destination parameter for the cp command?
Indicates that the destination is a directory.
What does the ln -s command do?
Creates a new symbolic directory entry (symbolic link) that points to another file and has the same modes as the other file. The linked files do not share the same contents.
What does ln command do?
Creates a new directory entry (hard link) that points to another file and has the same modes as the other file. The linked files share the same contents.
What does the mv command do?
Renames the file named by the source operand to the destination path named by the target operand. This form is assumed when the last operand does not name an already existing directory. OR Moves each file named by a source operand to a destination file in the existing directory named by the directory operand.
What does the rm command do?
Attempts to remove the non-directory type files specified on the command line.
What does the mkdir command do?
make directories command creates the directories named as operands, in the order specified, using mode rwxrwxrwx (0777) as modified by the current umask(2)