Command Line Crash Course Flashcards

Learn basics of terminal commands

1
Q

What does “rm -rf /” do?

A

delete all contents of current file/app

never type this

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

What does ‘pwd’ mean?

What does ‘pwd’ do?

A
  • print working directory

- it prints path of current directory

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

hostname

A

my computer’s network name

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

mkdir

A

make directory

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

cd

A

change directory

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

ls

A

list contents of directory

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

rmdir

A

remove directory

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

pushd

A

push directory

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

popd

A

pop directory

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

cp

A

copy a file or directory

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

mv

A

mv [current_name] [new_name]

move (or rename) a file or directory

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

less

A

page through a file

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

cat

A

print the whole file

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

xargs

A

execute argument

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

find

A

find files

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

grep

A

find things inside files

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

man

A

read a manual page

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

apropos

A

find what man page is appropriate

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

env

A

look at your environment

20
Q

echo

A

print some arguments

21
Q

export

A

export/set a new environment variable

22
Q

exit

A

exit the shell

23
Q

sudo

A

become super user root

DANGER! DANGER!

24
Q

chmod

A

change permission modifiers

25
Q

chown

A

change ownership

26
Q

What is bash?

A
  • command line?
27
Q

alternate name for “directory”?

A

folder

28
Q

alternate name for “folder”?

A

directory

29
Q

Unix or Windows command prompt:

$

A

Unix

30
Q

Unix or Windows command prompt:

>

A

Windows

31
Q

name for directories inside directories?

A

path

32
Q

What is a path?

A

a name for directories inside directories;

a set of directions to the computer for where you want to put something in the tree of folders;

33
Q

What is the “graphical file browser” (or “graphical user interface”) on a Mac?

A

Finder

34
Q

What does “cd ..” do?

A

moves up one directory (to parent directory)

35
Q

What does “cd ../..” do?

A

moves up two directories (to parent’s parent directory)

36
Q

What does CLI mean?

A

Command Line Interface

37
Q

alternate names for CLI

A

terminal;
bash;
(command line) prompt;

38
Q

What does GUI mean?

A

Graphical User Interface

39
Q

move to root directory

A

cd /

40
Q

move to home directory

A

cd ~

41
Q

What is the “graphical file browser” or (“graphical user interface”) for Windows?

A

Windows Explorer

42
Q

What does ‘ls -1R’ do?

A

prints all sub-directories

43
Q

What does ‘mkdir -p’ do?

A

creates a directory path (even if directories in path haven’t yet been created)

44
Q

touch

A

create new file (in current directory)

45
Q

cp -r

A
cp -r [directory_name] [new_directory_name]
copy directory (and its contents) and create new_directory_name
46
Q

What does ‘rm -rf [directory]’ do?

A

removes specified directory and all of its contents

47
Q

What does ‘rm -r [directory]’ do?

A

removes specified directory (if it is empty)

- if directory is not empty, use ‘rm -rf [directory]’