Commands Flashcards

Given name of command as question, given definition of command which is answer.

1
Q

pwd

A

print working directory

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

hostname

A

my computer’s network name

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

mkdir

A

make directory

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

cd

A

change directory

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

ls

A

list directory

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

rmdir

A

remove directory

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

pushd

A

push directory, takes you in and out of path you just pushed through

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

popd

A

pop directory, takes the last directory you pushed into, and “pops” it off, taking you back to pre-pushing

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

cp a.txt b.txt, cp a.txt directory/, and cp -r directoryx directoryy

A

copy a file or directory, can make copies of texts with new names, can make copies of texts into directories, and can copy directories into directories, which will include all files that were part of the pat

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

mv

A

move a file or directory

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

less

A

page through a file

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

cat

A

print the whole file

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

xargs

A

execute arguments

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

find

A

find files, find STARTDIR, the command is: -name “WILDCARD” - print…. and can | this to less

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

grep

A

find things inside files

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

man

A

read a manual page

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

apropos

A

find what man page is appropriate

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

env

A

look at your environment

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

echo

A

print some arguments

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

export

A

export/set a new environment variable

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

exit

A

exit the shell

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

sudo

A

DANGER! become super user root DANGER!

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

chmod

A

change permission modifiers

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

chown

A

change ownership

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

Command Line Reverse

print working directory

A

pwd

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

Command Line Reverse

my computer’s network name

A

hostname

27
Q

Command Line Reverse

make directory

A

mkdir

28
Q

Command Line Reverse

change directory

A

cd

29
Q

Command Line Reverse

list directory

A

ls

30
Q

Command Line Reverse

remove directory

A

rmdir

31
Q

Command Line Reverse

push directory

A

pushd

32
Q

Command Line Reverse

pop directory

A

popd

33
Q

Command Line Reverse

copy a file or directory

A

cp

34
Q

Command Line Reverse

move a file or directory

A

mv

35
Q

Command Line Reverse

page through a file

A

less

36
Q

Command Line Reverse

print the whole file

A

cat

37
Q

Command Line Reverse

execute arguments

A

xargs

38
Q

Command Line Reverse

find files, find STARTDIR, the command is: -name “WILDCARD” - print…. and can | this to less

A

find

39
Q

Command Line Reverse

find things inside files

A

grep

40
Q

Command Line Reverse

read a manual page

A

man

41
Q

Command Line Reverse

find what man page is appropriate

A

apropos

42
Q

Command Line Reverse

look at your environment

A

env

43
Q

Command Line Reverse

print some arguments

A

echo

44
Q

Command Line Reverse

export/set a new environment variable

A

export

45
Q

Command Line Reverse

exit the shell

A

exit

46
Q

Command Line Reverse

DANGER! become super user root DANGER!

A

sudo

47
Q

Command Line Reverse

change permission modifiers

A

chmod

48
Q

Command Line Reverse

change ownership

A

chown

49
Q

What does cat ex12.txt ex13.txt | less do?

A

The | takes the output from the command on the left, and “pipes” it to the command on the right.

50
Q

What does cat < ex13.txt do?

A

The < will take and send the input from the file on the right to the program on the left.

51
Q

What does cat ex13.txt > ex15.txt do?

A

It takes output of command on left, and writes it to the file on the right.

52
Q

What does >> do?

A

>> takes the output of the command on the left, then appends it to the file on the right.

53
Q

what does * do?

A

matches anything in a wildcard like *.txt

54
Q

what does rm *.txt do?

A

removes all of the .txt files that are in the directory you are in

55
Q

what is a path?

A

a hierarchy of directories

56
Q

how do you get space in name, when creating a directory name?

A

you put quotes around it when naming it

57
Q

what is difference between cd.. and cd?

A

cd .. moves you up one level of path, while cd returns you to the home

58
Q

are directory names case sensitive?

A

yes

59
Q

what does ls -lR do?

A

it returns everything that is in path at each level, starting at the highest level

60
Q

what does mkdir -p i/like/icecream do?

A

it will make you this entire path

61
Q

what commands can you think of as stacks?

A

pushd and popd, you can also have multiple stacks that you can pushd and popd in between, pushd moves stacks and popd removes stacks, stack that is on inside of the command line in the one that you have open to write commands on

62
Q

what is the difference between touch and mkdir?

A

touch creates file while mkdir makes folder

63
Q

can you rmdir if the directory is not empty?

A

no