Shell Commands Flashcards

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
mkdir “name with space”
mkdir -p stuff/things/orange/apple/pear/grape/

A

make directory

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

cd
cd ..
cd ../../../

A

change directory

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

ls

ls -a

A

list directory

list directory with invisible files

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

rmdir

rm -rf (to remove directory that is not empty)

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 your current directory and "pushes" it into a list for later, then it changes to another directory. It's like saying, "Save where I am, then go here.")
(swaps directories is donw without named directory)
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 and “pops” it off, taking you back there.

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

cp

cp -r to copy more directories with files in them.

A

copy file or directory

will overwrite so be careful

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

mv

A

rename 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

q to quit; space and w to page thru, or arrow keys

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

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

17
Q

apropros

A

find which man page is appropriate

18
Q

env

A

look at your environment

19
Q

echo

A

print some arguments

20
Q

export

A

export/set a new environment variable

21
Q

exit

A

exit the shell

22
Q

sudo

A

DANGER! become super user root

23
Q

touch

touch iamcool.txt

A

create a new empty file

24
Q
  1. rm

2. rm -rf

A
  1. remove a file

2. remove a directory with files in it