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
# Command Line Reverse print working directory
pwd
26
# Command Line Reverse my computer's network name
hostname
27
# Command Line Reverse make directory
mkdir
28
# Command Line Reverse change directory
cd
29
# Command Line Reverse list directory
ls
30
# Command Line Reverse remove directory
rmdir
31
# Command Line Reverse push directory
pushd
32
# Command Line Reverse pop directory
popd
33
# Command Line Reverse copy a file or directory
cp
34
# Command Line Reverse move a file or directory
mv
35
# Command Line Reverse page through a file
less
36
# Command Line Reverse print the whole file
cat
37
# Command Line Reverse execute arguments
xargs
38
# Command Line Reverse find files, find STARTDIR, the command is: -name "WILDCARD" - print.... and can | this to less
find
39
# Command Line Reverse find things inside files
grep
40
# Command Line Reverse read a manual page
man
41
# Command Line Reverse find what man page is appropriate
apropos
42
# Command Line Reverse look at your environment
env
43
# Command Line Reverse print some arguments
echo
44
# Command Line Reverse export/set a new environment variable
export
45
# Command Line Reverse exit the shell
exit
46
# Command Line Reverse DANGER! become super user root DANGER!
sudo
47
# Command Line Reverse change permission modifiers
chmod
48
# Command Line Reverse change ownership
chown
49
What does cat ex12.txt ex13.txt | less do?
The | takes the output from the command on the left, and "pipes" it to the command on the right.
50
What does cat \< ex13.txt do?
The \< will take and send the input from the file on the right to the program on the left.
51
What does cat ex13.txt \> ex15.txt do?
It takes output of command on left, and writes it to the file on the right.
52
What does \>\> do?
\>\> takes the output of the command on the left, then appends it to the file on the right.
53
what does \* do?
matches anything in a wildcard like \*.txt
54
what does rm \*.txt do?
removes all of the .txt files that are in the directory you are in
55
what is a path?
a hierarchy of directories
56
how do you get space in name, when creating a directory name?
you put quotes around it when naming it
57
what is difference between cd.. and cd?
cd .. moves you up one level of path, while cd returns you to the home
58
are directory names case sensitive?
yes
59
what does ls -lR do?
it returns everything that is in path at each level, starting at the highest level
60
what does mkdir -p i/like/icecream do?
it will make you this entire path
61
what commands can you think of as stacks?
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
what is the difference between touch and mkdir?
touch creates file while mkdir makes folder
63
can you rmdir if the directory is not empty?
no