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
Q

su + username + user password

A

switch user

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

sudo -k

A

end admin root privileges
(will need to enter password again)

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

sudo -s

A

log into root shell

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

rwx

A

read (read only)
write (write only)
execute (run the file)

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

chmod

A

changes permission mode string (eg. rwx)

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

chown

A

change owner

31
Q

chgroup

A

change group

32
Q

touch

A

create new file

33
Q

nano test.sh

A

edit test.sh file

34
Q

ln -s

A

symbolic (soft) link

35
Q

ln

A

absolute path (hard) link

36
Q

echo

A

prints out whatever text you give as an argument
(eg. echo “Hello” outputs Hello

37
Q


(symbol)

A

pipe to connect commands

38
Q

wc

A

word count

39
Q

cat

A

concatenate

40
Q

head

A

outputs first 10 lines of text

41
Q

tail

A

outputs last 10 lines of text

42
Q

-n(number)

A

specify to head or tail command how many lines to output

43
Q

-n

A

adds line number to each line of text

44
Q

less

A

displays text one page/screenful at a time and provides navigation controls.
Can use same controls as for manual

45
Q

grep

A

searches files for matching patterns
(eg. grep “the” poems.txt)

46
Q

-i

A

case insensitive for pattern

47
Q

-v

A

omit lines with the pattern

48
Q

-E

A

using regex (eg. grep -E “\w{6,}” poems.txt
highlights any word at least 6 word characters long

49
Q

sort -n

A

sort numerically

50
Q

sed s/old data/new data file.txt

A

substitute new for old in simple text file

51
Q

sort

A

sorts by first column data

52
Q

sort -k

A

sort by sort key

53
Q

sort -k2 -n

A

sort 2nd column numerically

54
Q

sort -u

A

only unique lines, removes duplicates

55
Q

rev

A

prints text in reverse sequence

56
Q

tac

A

concatenates or displays files in reverse

57
Q

tr

A

translates or modifies individual characters according to parameters

58
Q

VIM

A

text editor

59
Q

i
(VIM)

A

insertion mode

60
Q

esc
(VIM)

A

go back to command mode

61
Q

I
(VIM)

A

insert at beginning of line

62
Q

:w new.txt
(VIM)

A

saving new file

63
Q

:wq
(VIM)

A

save and quit

64
Q

G

A

move to bottom of file

65
Q

1G

A

move to top of file

66
Q

( or )

A

move forwards and backwards by line

67
Q

{ or }

A

move forwards or backwards by paragraph

68
Q

:q!
(VIM)

A

quit without saving

69
Q

o

A

insert on following line

70
Q

nano

A

lightweight text editor
includes command legend on screen

71
Q

ctrl + w
(nano)

A

search text for wordc

72
Q

ctrl + v
(nano)

A

move down a screen

73
Q

ctrl + y
(nano)

A

move up a screen