Command Line Flashcards

Prompts to help navigate your terminal. (13 cards)

1
Q

rm - v

A

rm = remove a file
-v = view the removed file(s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

rm -r

A

rm -r removes a directory recursively

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

pwd

A

present working directory (to see the directory you’re currently in)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

cp

A

cp copies files or directories. cp file1 file2 will copy file1 to file2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

mv

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

cat

A

cat allows us to create single or multiple files, view contain of file, concatenate files and redirect output in terminal or files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

grep

A

grep stands for “global regular expression print”. It searches files for lines that match a pattern and returns the results. It is case sensitive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

man

A

man command shows the manual for the specified command

man command_name
man ls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

chmod

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

> >

A

> > takes the standard output of the command on the left and appends (adds) it to the file on the right. Example: cat glaciers.txt&raquo_space; rivers.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

<

A

< takes the standard input from the file on the right and inputs it into the program on the left. Example: cat < lakes.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

|

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

wc

A

word count

How well did you know this?
1
Not at all
2
3
4
5
Perfectly