linux commands Flashcards

1
Q

pwd

A

Print the working directory you are in

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

cd ..

A

return to the previous directory

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

ls

A

list all files in the working directory

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

ls –rtl

A

display detailed information about all files in the working directory and sort by their
modification time in ascending order

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

ls –l

A

display detailed information about all files in the working directory

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

cd

A

change the working directory to your home directory

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

mkdir test

A

short for make directory. used to create directories on a file system

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

rmdir test

A

short for make directory. used to create directories on a file system

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

rmdir test

A

short for remove directory. used to remove/delete directories on a file system

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

chmod [newpermission] [filenames]

A

u : user (yourself)
g: group
o: others (rest of the world)
a: all of the above (u, g and o)
-:remove this permission
+: add this permission
r: read access
w: write access
x: execute access

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

chmod g-r test

A

remove read access form group

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

chmod uog+rwx test

A

add read, write and excesute access to user, group and others

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

who

A

get the information on curreclty logged in users

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

ps -ef

A

see processes on the system. pipes the output to “less” to make it scrollable

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

ps -fu user4

A

see processes on user 4 system

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

finger

A

used to display information about local and remote users (similar to who)

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

ifconfig -a:

A

display the status of all interfaces, even those that are down (show IP adress)

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

kill -9 2168

A

the kill command is used to terminate processes without having to log out or reboot (restart) the computer. 2168 is the PID of the process

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

PPID is

A

the parent process ID of PID

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

definition od bash

A

the standard shell for common users (linux)

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

korn shell

A

unix shell

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

ksh

A

used to change execution method to ksh

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

exit after ksh

A

used to exit ksh

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

scripts

A

collection of commands that are stored in a file. the shell can read this file and act on the command as if they were typed at the keyboard

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

vi test.sh

A

short for visual text editor. create test.sh (script) file, it is an interactive test editor.

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

echo “hello world”

A

show hello world on the screen

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

sleep 10

A

stop processes for 10 seconds

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

./test.sh

A

to excute the script

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

find . -name toto -print

A

automatically find the file’s path by its name

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

explane . in
find . -name toto -print

A

start search from currect location

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

explane toto in
find . -name toto -print

A

name of the file is toto

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

explane -print in
find . -name toto -print

A

show the location (path) on the screen

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

cd /etc

etc:

A

location where there are files controlling the machines configuration like IP adress. It is one of the system directories.

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

ls -rtl resolv.conf

A

get detailed information about resolv.conf only

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

find / -name resolv.conf -print

A

search the entire machine for file “resolv.conf” and print the path on the screen (usually the system does not allow, therefore you must log in the root)

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

find / -name resolv.conf -print | more

A

show the output in pages because ( | more ) is used

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

find / -name **ress** -print

A

this command is used if you are trying to find a file that you only remember a few letters of those letters are put in this letters ** ** the stars indicate any letter

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

find / -name **ress** -print > toto

A

save the output of the search in file (toto). file toto is created automatically due to this command and the output is automatically in the file

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

passwd

A

changes the password

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

vi toto

A

opens a file

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

:q

A

to exit

42
Q

dd

A

remove line

43
Q

4dd

A

removes 4 lines

44
Q

u

A

undo

45
Q

x

A

delete one character

46
Q

i

A

insertion mode

47
Q

a

A

insertion mode after the cursor

48
Q

o

A

write in a new line

49
Q

:w

A

save in memory

50
Q

shift g

A

go to the end of the file

51
Q

1 shift g

A

go to the begining of the file

52
Q

Print the working directory you are in

A

pwd

53
Q

return to the previous directory

A

cd ..

54
Q

list all files in the working directory

A

ls

55
Q

display detailed information about all files in the working directory and sort by their
modification time in ascending order

A

ls –rtl

56
Q

display detailed information about all files in the working directory

A

ls –l

57
Q

change the working directory to your home directory

A

cd

58
Q

short for make directory. used to create directories on a file system

A

mkdir test

59
Q

short for make directory. used to create directories on a file system

A

rmdir test

60
Q

short for remove directory. used to remove/delete directories on a file system

A

rmdir test

61
Q

u : user (yourself)
g: group
o: others (rest of the world)
a: all of the above (u, g and o)
-:remove this permission
+: add this permission
r: read access
w: write access
x: execute access

A

chmod [newpermission] [filenames]

62
Q

remove read access form group

A

chmod g-r test

63
Q

add read, write and excesute access to user, group and others

A

chmod uog+rwx test

64
Q

get the information on curreclty logged in users

A

who

65
Q

see processes on the system. pipes the output to “less” to make it scrollable

A

ps -ef

66
Q

see processes on user 4 system

A

ps -fu user4

67
Q

used to display information about local and remote users (similar to who)

A

finger

68
Q

display the status of all interfaces, even those that are down (show IP adress)

A

ifconfig -a:

69
Q

the kill command is used to terminate processes without having to log out or reboot (restart) the computer. 2168 is the PID of the process

A

kill -9 2168

70
Q

the parent process ID of PID

A

PPID is

71
Q

the standard shell for common users (linux)

A

definition od bash

72
Q

unix shell

A

korn shell

73
Q

used to change execution method to ksh

A

ksh

74
Q

used to exit ksh

A

exit after ksh

75
Q

collection of commands that are stored in a file. the shell can read this file and act on the command as if they were typed at the keyboard

A

scripts

76
Q

short for visual text editor. create test.sh (script) file, it is an interactive test editor.

A

vi test.sh

77
Q

show hello world on the screen

A

echo “hello world”

78
Q

stop processes for 10 seconds

A

sleep 10

79
Q

to excute the script

A

./test.sh

80
Q

automatically find the file’s path by its name

A

find . -name toto -print

81
Q

start search from currect location

A

explane . in
find . -name toto -print

82
Q

name of the file is toto

A

explane toto in
find . -name toto -print

83
Q

show the location (path) on the screen

A

explane -print in
find . -name toto -print

84
Q

location where there are files controlling the machines configuration like IP adress. It is one of the system directories.

A

cd /etc

etc:

85
Q

get detailed information about resolv.conf only

A

ls -rtl resolv.conf

86
Q

search the entire machine for file “resolv.conf” and print the path on the screen (usually the system does not allow, therefore you must log in the root)

A

find / -name resolv.conf -print

87
Q

show the output in pages because ( | more ) is used

A

find / -name resolv.conf -print | more

88
Q

this command is used if you are trying to find a file that you only remember a few letters of those letters are put in this letters ** ** the stars indicate any letter

A

find / -name **ress** -print

89
Q

save the output of the search in file (toto). file toto is created automatically due to this command and the output is automatically in the file

A

find / -name **ress** -print > toto

90
Q

changes the password

A

passwd

91
Q

opens a file

A

vi toto

92
Q

to exit

A

:q

93
Q

remove line

A

dd

94
Q

removes 4 lines

A

4dd

95
Q

undo

A

u

96
Q

delete one character

A

x

97
Q

insertion mode

A

i

98
Q

insertion mode after the cursor

A

a

99
Q

write in a new line

A

o

100
Q

save in memory

A

:w

101
Q

go to the end of the file

A

shift g

102
Q

go to the begining of the file

A

1 shift g