Commands Flashcards
What is the “less” utility
A pager
What is the copy file command
cp sourceFilepath destinationFilepath
How do you rename a file
mv
How do you move a file
mv sourceFilepath destinationDirectory
How do you compare files
diff -u file1 file2
What is the wc command
Word count
What is the command that compresses multiple files for linux systems
tar
Why is it called “tar”
Short for “tape archive”, this command used to be only for creating and reading archive and backup tapes
How do you find the full pathname of the file in your PATH of a non-builtin utility
which utilityToFind
What does the “which” command do
Returns the first pathname found in the directories of $PATH of a utility you provide as an argument
How do you look for files related to a non-builtin utility in standard locations
whereis filesToFind
What does the “whereis” command do
Searches standard locations (instead of $PATH directories) for files relating to a utility you specify
How do you find files using a keyword as to loosely match filenames to
locate keywordOfFilenamesToLooselyMatch
What does the “locate” command do
Finds loosely matched filenames and returns their filepath
What are the 3 commands to see who is using the system
w
who
finger
Which “who” command shows system usage information
w
Which “who” command displays the least amount of information
who
Which “who” command displays the most human profile information
finger
Which command shows system memory information
free
What does the “free” command do
Shows system memory information
How do you write to a user
write userToSendTo
How do you enable messaging
mesg y
What is the “ls” option to show hidden files
-a
What does the “pwd” command do
Prints the current working directory
How do you print the current working directory
pwd
What command makes a new directory
mkdir nameWithOptionalPath
What does “mkdir” do
Makes a new directory
What command changes your directory
cd absoluteOrRelativePath
How do you remove a directory
rmdir pathOfDirectoryToRemove; the directory must be empty.
You can use rm -r to recursively delete the contents of a directory, but making a mistake can be disasterous
What does “rmdir” do
Removes a directory
What does “chmod” do
Changes permissions of a file
How do you change permissions of a file
chmod newPermissions fileToChange
The “cat” command without arguments will start concatenating a string that you type, and includes newlines. How do you finish this?
ctrl-d (end of file)
What do the >, <, and > > symbols do
Redirection
Which is the redirect output symbol
>
Which is the redirect input symbol
<
In BASH, how do you enable and disable overwriting files via redirection
disable:
set -o noclobber
enable
set +o noclobber
Which is the append output symbol
> >
How do you append the end of a file
> >