Linux Commands Flashcards

1
Q

cd

A

change directory (without specifications changes to home automatically)

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

hostname

A

displays system name

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

TAB key

A

autocomplete as much of filename as system can

  • if name has been completed, there will be a space after name
  • press TAB again to display a list of possible completions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

TAB key + RETURN key

A

execute command (that was autocompleted)

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

ls-l

A

determine file type

  • hyphen infront of file listed = regular file
  • b or C indicates a device file
  • d indicates a directory file

ls commands can be combined!

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

ls -ld

A

detailed listing command, get info on just directory files

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

ls -a

A

show all files including hidden files

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

ls -A

A

show Almost all files, not include . and .. files

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

ls -F

A

displays / after directory, * after executable file

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

pwd

A

print working directory

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

cd directorypath

A

change to a directory

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

mkdir directorypath

A

create a subdirectory with a directory

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

mkdir -p

A

create parent directories and directories

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

rmdir directorypath

A

removes empty directories

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

mv sourcepath destinationpath

A

move file to a new location OR rename file OR moves directories

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

mv -i

A

asks for confirmation if file already exists before moving

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

lpr

A

put one or more file in que for printing

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

lpr -P [insert printer name] [insert filename]

A

place file in que for specific printer

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

lpstat -p

A

display list of available printers

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

lpstat -o

A

view which jobs are in printer

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

lprm

A

remove job from printer

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

cp sourcepath destinationpath

A

copy file from one location to another, or backup important files

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

cp -i

A

asks for confirmation if file already exists before copying

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

cp -r

A

allows for copying of directories and their contents

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

grep ‘searchingfor’ filename

A

search for ‘string’ in filename

26
Q

grep -w

A

search for only whole words

27
Q

head

A

displays beginning (first 10 lines) of file

28
Q

head -#

A

displays desired number of lines from beginning of file

29
Q

tail

A

displays the end (last 10 lines) of file

30
Q

tail -f filename

A

monitor lines as added to file

CONTROL + C to stop shell and display prompt

31
Q

sort

A

displays files in order (automatically alphabetical)

32
Q

sort -u

A

displays unique lines, no duplicates

33
Q

sort -n

A

lists of numbers in numerical order

34
Q

uniq

A

removes duplicate lines from a file

35
Q

diff

A

compare two files and display a list of the differences between them

36
Q

diff -u

A

displays two lines indicating which of the files are being compared with a plus sign (+) and a minus sign (-)

37
Q

rm filepath

A

remove regular file

38
Q

rm -r filepath

A

recursively remove directory and contents (this includes all subdirectories)

39
Q

rm -i

A

include confirm deletion of subdirectories and contents

40
Q

cat filepath

A

join files, shows contents of multiple files on screen

41
Q

more filepath

A

display contents of large regular files one screen at a time

42
Q

less filepath

A

same as more, just contains more navigation features

43
Q

touch path

A

update date and time of existing files OR create empty files

44
Q

find XXXX

A

find file

45
Q

find / -name bob

A

find filename containing “bob”

46
Q

find / -user alice

A

find filename with user “alice”

47
Q

find / name XXX -empty -delete

A

find, empty and delete file with name XXX

48
Q

find / -mmin

A

find files made within 5 minutes

49
Q

find / -size + 100M

A

find files over 100 MB

50
Q

man [options] command

A

access online manual related to “command”

51
Q

man -k command

A

provide short explanation relating to commands matching string. Used if user doesn’t know name of command

52
Q

chmod ### filename

A

change permissions

53
Q

umask ### filename

A

change permissions

54
Q

rm -rf

A

remove files and directories recursively by force, even if they are protected from deletion

55
Q

chmod g+rw filename

A

add permissions

56
Q

chmod g-rw filename

A

remove permissions

57
Q

chmod g=rw filename

A

set permissions

58
Q

chmod u=rwx,g+x,o= .

A

combined

59
Q

sort -f

A

???

60
Q

grep -i

A

???