command line commands Flashcards

1
Q

what is the man (command shortcut) command?

e.g. man cat

A

it gives you the manual for the given command shortcut (in this case, cat, or catalog)

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

what is the cat (file name) command?

A

you can use cat (file) to print the contents of one file, or more than one by simply adding more arguments to the command line

e.g.
cat laziness.txt impatience.txt

it can also be used with the > command to combine the contents of files INTO new files, like this:
cat laziness.txt impatience.txt hubris.txt > three-virtues.txt

the above would create a new file named “three-virtues.txt”

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

what is the ls (file name) command?

A

it gives you a list of ALL the files in a directory. simply type the argument “ls” w/nothing else

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

what is the cat (file name) command?

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

what is the pwd command?

A

it prints the name (file path) of the current working directory

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

what is the ls command?

A

it gives you a list of files in a directory

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

what is the echo command?

A

it allows you to write a line of text, and you can write to a file like this:

echo ‘Hello, World!’ > hello.txt

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

what is the mcdir command?

A

it makes directories, like this:

mcdir parent

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

what is the touch command?

A

it changes the file timestamp

use the man touch comment for more info

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

what is the mv command?

A

it allows u to move or rename files

e.g.
mv poikemon pokemon fixes pokemon’s spelling by changing it

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

what is the rm command?

A

it removes files or directories

e.g.
rm lol.txt for files or
rm kill-me/ for files

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

what is the rm command?

A

copy files or directories
e.g.
cp and-then.txt no-and-then.txt
copies the former to a new file, the latter

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