Unix Flashcards

1
Q

command for: list contents of current directory

A

ls

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

command for: make a directory

A

mkdir

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

command for move:

A

mv

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

command for rename:

A

mv

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

what would the command be to move text1 into directory files

A

mv text1 files

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

command for changing to a directory:

A

cd

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

command for printing current directory to the terminal:

A

pwd

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

command to move to previous directory:

A

cd ..

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

command to show contents of a file:

A

more

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

command to copy:

A

cp

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

command to remove:

A

rm

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

command to remove a directory:

A

rmdir

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

command to change security permissions:

A

chmod

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

command to do a long list of files:

A

ls -l

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

addition to ls if we want to see details of files and direcetories:

A

ls -l

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

wildcard to match anything (to be read by shell):

A

*

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

in file permissions what are u,g,o?

A

u = user
g = groups
o = the rest

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

how would you see what permission groups you’re in?

A

groups

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

in file permissions, what are r,w,x?

A

r = read
w = write
x = execute

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

what symbol can be used for home directory?

21
Q

how can the home directory symbol be used to mean someone else’s home directory?

A

~theiruserid

22
Q

what does man -k do?

A

search manual for a following word

23
Q

what is the command to find someones username?

24
Q

what is the quick way to write current directory in a pathname?

25
Q

what is the command for printing two files together?

26
Q

what does > do?

A

replaces the following file with the content before the symbol

27
Q

what does ‘»’ do?

A

appends the content before the symbol to the file that follows

28
Q

command to copy a directory?

29
Q

command to see how much disk space is free?

30
Q

command to remove a directory and everything in it?

31
Q

command to list all processes?

32
Q

meaning of |?

A

‘pipes’ the result of a previous command into another

33
Q

command to end a process?

34
Q

what does -9 do to the kill command?

A

tells the process to die immediately and not ‘tidy up’

35
Q

how do you exit a more command?

36
Q

what does it mean for a file to begin with a .

A

hidden file

37
Q

what does -r do to ls?

A

lists things recursively from a directory

38
Q

how would you create an empty text file from the terminal?

39
Q

what does the command du do?

A

it shows the disk usage for the current directory and its subdirectories.

40
Q

how does -s change the result of du?

A

summary - shows disk usage of current directory without splitting it up for each subdirectory

41
Q

how does -s* affect the result of du?

A

shows summarised disk usage information for each subdirectory of the directory

42
Q

what does -alg do to ls?

A

a = show all
l = long listing
g = omit owner column

43
Q

what does grep do?

A

search for a particular string or pattern in a file

44
Q

what needs to be used with grep if we want to search for a string of several words?

A

” “ quote marks otherwise the shell tries to interpret the space

45
Q

how would you redirect the errors of a command somewhere?

A

command > (where you want normal results) > (where you want errors)

46
Q

what would grep interpret “st.” as?

A

st followed by any single character

47
Q

whta does \ do inside quotes for grep?

A

the next character is read literally rather than as a regular expression

48
Q

how do you get a \ to be read literally?

A

with another backslash \

49
Q

what’s the difference between ls -r and ls -R ?

A

ls -r lists recursively from the bottom up whereas ls -R lists more typically from top down