Command Line Flashcards
Prompts to help navigate your terminal. (13 cards)
rm - v
rm = remove a file
-v = view the removed file(s)
rm -r
rm -r removes a directory recursively
pwd
present working directory (to see the directory you’re currently in)
cp
cp copies files or directories. cp file1 file2 will copy file1 to file2
mv
To move a file into a directory, use mv with the source file as the first argument and the destination directory as the second argument
cat
cat allows us to create single or multiple files, view contain of file, concatenate files and redirect output in terminal or files.
grep
grep stands for “global regular expression print”. It searches files for lines that match a pattern and returns the results. It is case sensitive.
man
man command shows the manual for the specified command
man command_name
man ls
chmod
chmod ugo file changes permissions of file to ugo - u is the user’s permissions, g is the group’s permissions, and o is everyone else’s permissions. The values of u, g, and o can be any number between 0 and 7.
> >
> > takes the standard output of the command on the left and appends (adds) it to the file on the right. Example: cat glaciers.txt»_space; rivers.txt
<
< takes the standard input from the file on the right and inputs it into the program on the left. Example: cat < lakes.txt
|
is a “pipe”. The | takes the standard output of the command on the left, and pipes it as standard input to the command on the right. You can think of this as “command to command” redirection. Example: cat volcanoes.txt | wc
wc
word count