Bash 101 Flashcards

1
Q

Print working directory

A

pwd

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

Remove a folder and its files, forcibly

A

rm -rf filename

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

In Less, go to the previous search term

A

N

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

Modifier to make string searching case insensitive and recursive

A

-ri

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

Go to the last directory you were in

A

Cd -

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

&&

A

Perform both commands, but only the second if the first completed

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

In Less, search

A

/

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

Flag for listing files by reverse time modified

A

-rt

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

Tab

A

Tab completion

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

In Less, go to the next search term

A

n

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

Run the last command again (specific)

A

!cmd

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

Show running processes

A

ps

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

Pipe character

A

Funnel the output to the command after the pipe, instead of STDOUT

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

In Less, back or forward a page

A

^B

^F or space

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

Erase from cursor to beginning of line

A

^ U

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

Kill a process

A

Kill

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

In Less, move to the beginning of the file

A

1G

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

Move cursor to beginning of line

A

^ A

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

In Less, quit

A

q

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

In Less, move to the end of the file

A

G

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

Flag for showing hidden files with ls

A

-a

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

Remove a folder (no files in it)

A

Rmdir

39
Q

Search for a string matching the argument

A

grep

40
Q

Kill matching processes

A

pkill - -f

41
Q

Flag for showing human readable form with ls

A

-h

42
Q

Refer to the directory one level up

A

..

43
Q

Copy a file to new location

A

Cp

44
Q

Concatenate to the end of the file

A

Arg&raquo_space; file.txt

45
Q

Refer to the current directory

A

.

47
Q

;

A

Perform both commands, regardless of whether the first was performed successfully

48
Q

Give the directory of a command (or check it exists)

A

Which

50
Q

Word count in lines, words and bytes

A

Wc

54
Q

Top

A

Show processes, sorted

55
Q

Move a file or rename it

A

Mv file1 file2

56
Q

Look for a file or directory

A

Find

57
Q

Run last command (any)

A

!!

60
Q

Create an empty file

A

Touch

61
Q

Head/tail

A

Look at the first/last 10 lines of a file

63
Q

Exit

A

^D

65
Q

Flag for showing long form with ls

A

-l

66
Q

See command history

A

History

67
Q

Download a file from the internet

A

Curl

68
Q

View the manual for a command

A

Man cmd

73
Q

Search through previous commands to find one

A

^R

77
Q

!n

A

Run the nth last command again

79
Q

Remove a file

A

Rm

81
Q

List files

A

ls

82
Q

Flag to forcibly, recursively remove files

A

-rf

84
Q

Clear screen

A

^ L

85
Q

Redirect operator

A

>

90
Q

Flag for showing directory content as well as names with ls

A

-d

92
Q

View the difference between two files

A

Diff

94
Q

Concatenate and print

A

Cat

104
Q

Move cursor to end of line

A

^ E