Unix Flashcards

1
Q

ls

A

list files in current directory

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

ls -l

A

list files in a long format

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

ls -a

A

list all files (including hidden files) in current directory

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

ls -F

A

adds indicators to the list output to identify directories and different types of files.

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

.

A

the current working directory

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

..

A

the parent directory to working directory

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

~

A

your home directory

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

/

A

the root (top-level) directory. This is also the separator for directories

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

*

A

a wildcard meaning any string of characters

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

?

A

a wildcard meaning any single character

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

cp file1 file2

A

makes a copy of file1 and calls it file2

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

mv file1 file2

A

renames file1 to file2

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

rm file1

A

removes (deletes) file1

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

rm -i file1

A

asks for confirmation that you want to delete file1

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

pwd

A

print the working directory

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

cd dirname

A

change directory to the one called “dirname”

17
Q

cd ..

A

change to the parent directory of the current directory

18
Q

cd ~

A

change to your home directory

19
Q

mkdir dirname

A

makes a new directory with the name “dirname”

20
Q

rmdir dirname

A

removes the directory with the name “dirname”. The directory must be empty

21
Q

rm -r dirname

A

recursively removes directories and subdirectories

22
Q

cat file1

A

writes the whole of file “file1” to the terminal, also useful for concatenating files

23
Q

more file1

A

displays the file “file1” a page at a time

24
Q

less file1

A

a more versatile version of “more”, but less common

25
Q

head -30 file1

A

Show the first 30 lines

26
Q

tail -25 file1

A

show the last 25 lines

27
Q

tail -f file1

A

show the last few lines and keep updating as the file grows

28
Q

wc file1

A

counts lines, words and characters in a file

29
Q

man utilityname

A

manual pages for the command “utilityname”

30
Q

ctrl C

A

interrupts whatever is currently running.
(It can get you out of trouble at embarrassing moments)

31
Q

ctrl Z

A

puts a foreground process into the background.

32
Q

ctrl S

A

suspends current terminal

33
Q

ctrl Q

A

resumes current terminal