Bash 101 Flashcards

(54 cards)

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)

39
Q

Search for a string matching the argument

40
Q

Kill matching processes

41
Flag for showing human readable form with ls
-h
42
Refer to the directory one level up
..
43
Copy a file to new location
Cp
44
Concatenate to the end of the file
Arg >> file.txt
45
Refer to the current directory
.
47
;
Perform both commands, regardless of whether the first was performed successfully
48
Give the directory of a command (or check it exists)
Which
50
Word count in lines, words and bytes
Wc
54
Top
Show processes, sorted
55
Move a file or rename it
Mv file1 file2
56
Look for a file or directory
Find
57
Run last command (any)
!!
60
Create an empty file
Touch
61
Head/tail
Look at the first/last 10 lines of a file
63
Exit
^D
65
Flag for showing long form with ls
-l
66
See command history
History
67
Download a file from the internet
Curl
68
View the manual for a command
Man cmd
73
Search through previous commands to find one
^R
77
!n
Run the nth last command again
79
Remove a file
Rm
81
List files
ls
82
Flag to forcibly, recursively remove files
-rf
84
Clear screen
^ L
85
Redirect operator
>
90
Flag for showing directory content as well as names with ls
-d
92
View the difference between two files
Diff
94
Concatenate and print
Cat
104
Move cursor to end of line
^ E