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
grep 'searchingfor' filename
search for 'string' in filename
26
grep -w
search for only whole words
27
head
displays beginning (first 10 lines) of file
28
head -#
displays desired number of lines from beginning of file
29
tail
displays the end (last 10 lines) of file
30
tail -f filename
monitor lines as added to file | CONTROL + C to stop shell and display prompt
31
sort
displays files in order (automatically alphabetical)
32
sort -u
displays unique lines, no duplicates
33
sort -n
lists of numbers in numerical order
34
uniq
removes duplicate lines from a file
35
diff
compare two files and display a list of the differences between them
36
diff -u
displays two lines indicating which of the files are being compared with a plus sign (+) and a minus sign (-)
37
rm filepath
remove regular file
38
rm -r filepath
recursively remove directory and contents (this includes all subdirectories)
39
rm -i
include confirm deletion of subdirectories and contents
40
cat filepath
join files, shows contents of multiple files on screen
41
more filepath
display contents of large regular files one screen at a time
42
less filepath
same as more, just contains more navigation features
43
touch path
update date and time of existing files OR create empty files
44
find XXXX
find file
45
find / -name bob
find filename containing "bob"
46
find / -user alice
find filename with user "alice"
47
find / name XXX -empty -delete
find, empty and delete file with name XXX
48
find / -mmin
find files made within 5 minutes
49
find / -size + 100M
find files over 100 MB
50
man [options] command
access online manual related to "command"
51
man -k command
provide short explanation relating to commands matching string. Used if user doesn't know name of command
52
chmod ### filename
change permissions
53
umask ### filename
change permissions
54
rm -rf
remove files and directories recursively by force, even if they are protected from deletion
55
chmod g+rw filename
add permissions
56
chmod g-rw filename
remove permissions
57
chmod g=rw filename
set permissions
58
chmod u=rwx,g+x,o= .
combined
59
sort -f
???
60
grep -i
???