Linux BASH commands Flashcards

1
Q

ls

A

list

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

man

A

manual

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

apropos + “…”

A

search for this phrase

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

Ctrl + C

A

cancel command

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

Ctrl + A

A

go to beginning of line

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

Ctrl + E

A

go to end of line

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

f

A

go forward in manual

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

b

A

go backward in manual

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

cd

A

change directory

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

tab

A

autofill command

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

pwd

A

Print Name of Working Directory

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

ls -R + argument

A

search directory and print its documents
(recursive)

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

mkdir

A

make new directory

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

mkdir -p

A

create necessary parent directories

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

rmdir

A

remove directory
(directory must be empty)

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

cp

A

copy

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

cd ..

A

move up one directory

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

mv

A

move

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

mv (file) .

A

move to current working directory

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

mv *.txt (directory)

A

move all text files to specified directory

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

mv (directory/)* .

A

move to current working directory

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

rm

A

remove

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

?
(linux)

A

one character

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

find + directory + search criteria (eg. -name) + search term (eg. “poe*”)

A

find file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
su + username + user password
switch user
26
sudo -k
end admin root privileges (will need to enter password again)
27
sudo -s
log into root shell
28
rwx
read (read only) write (write only) execute (run the file)
29
chmod
changes permission mode string (eg. rwx)
30
chown
change owner
31
chgroup
change group
32
touch
create new file
33
nano test.sh
edit test.sh file
34
ln -s
symbolic (soft) link
35
ln
absolute path (hard) link
36
echo
prints out whatever text you give as an argument (eg. echo "Hello" outputs Hello
37
| (symbol)
pipe to connect commands
38
wc
word count
39
cat
concatenate
40
head
outputs first 10 lines of text
41
tail
outputs last 10 lines of text
42
-n(number)
specify to head or tail command how many lines to output
43
-n
adds line number to each line of text
44
less
displays text one page/screenful at a time and provides navigation controls. Can use same controls as for manual
45
grep
searches files for matching patterns (eg. grep "the" poems.txt)
46
-i
case insensitive for pattern
47
-v
omit lines with the pattern
48
-E
using regex (eg. grep -E "\w{6,}" poems.txt highlights any word at least 6 word characters long
49
sort -n
sort numerically
50
sed s/old data/new data file.txt
substitute new for old in simple text file
51
sort
sorts by first column data
52
sort -k
sort by sort key
53
sort -k2 -n
sort 2nd column numerically
54
sort -u
only unique lines, removes duplicates
55
rev
prints text in reverse sequence
56
tac
concatenates or displays files in reverse
57
tr
translates or modifies individual characters according to parameters
58
VIM
text editor
59
i (VIM)
insertion mode
60
esc (VIM)
go back to command mode
61
I (VIM)
insert at beginning of line
62
:w new.txt (VIM)
saving new file
63
:wq (VIM)
save and quit
64
G
move to bottom of file
65
1G
move to top of file
66
**(** or **)**
move forwards and backwards by line
67
**{** or **}**
move forwards or backwards by paragraph
68
:q! (VIM)
quit without saving
69
o
insert on following line
70
nano
lightweight text editor includes command legend on screen
71
ctrl + w (nano)
search text for wordc
72
ctrl + v (nano)
move down a screen
73
ctrl + y (nano)
move up a screen