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
vi test.sh
short for visual text editor. create test.sh (script) file, it is an interactive test editor.
26
echo "hello world"
show hello world on the screen
27
sleep 10
stop processes for 10 seconds
28
./test.sh
to excute the script
29
find . -name toto -print
automatically find the file's path by its name
30
explane . in find . -name toto -print
start search from currect location
31
explane toto in find . -name toto -print
name of the file is toto
32
explane -print in find . -name toto -print
show the location (path) on the screen
33
cd /etc etc:
location where there are files controlling the machines configuration like IP adress. It is one of the system directories.
34
ls -rtl resolv.conf
get detailed information about resolv.conf only
35
find / -name resolv.conf -print
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)
36
find / -name resolv.conf -print | more
show the output in pages because ( | more ) is used
37
find / -name \*\*ress\*\* -print
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
38
find / -name \*\*ress\*\* -print \> toto
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
39
passwd
changes the password
40
vi toto
opens a file
41
:q
to exit
42
dd
remove line
43
4dd
removes 4 lines
44
u
undo
45
x
delete one character
46
i
insertion mode
47
a
insertion mode after the cursor
48
o
write in a new line
49
:w
save in memory
50
shift g
go to the end of the file
51
1 shift g
go to the begining of the file
52
Print the working directory you are in
pwd
53
return to the previous directory
cd ..
54
list all files in the working directory
ls
55
display detailed information about all files in the working directory and sort by their modification time in ascending order
ls –rtl
56
display detailed information about all files in the working directory
ls –l
57
change the working directory to your home directory
cd
58
short for make directory. used to create directories on a file system
mkdir test
59
short for make directory. used to create directories on a file system
rmdir test
60
short for remove directory. used to remove/delete directories on a file system
rmdir test
61
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
chmod [newpermission] [filenames]
62
remove read access form group
chmod g-r test
63
add read, write and excesute access to user, group and others
chmod uog+rwx test
64
get the information on curreclty logged in users
who
65
see processes on the system. pipes the output to "less" to make it scrollable
ps -ef
66
see processes on user 4 system
ps -fu user4
67
used to display information about local and remote users (similar to who)
finger
68
display the status of all interfaces, even those that are down (show IP adress)
ifconfig -a:
69
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
kill -9 2168
70
the parent process ID of PID
PPID is
71
the standard shell for common users (linux)
definition od bash
72
unix shell
korn shell
73
used to change execution method to ksh
ksh
74
used to exit ksh
exit after ksh
75
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
scripts
76
short for visual text editor. create test.sh (script) file, it is an interactive test editor.
vi test.sh
77
show hello world on the screen
echo "hello world"
78
stop processes for 10 seconds
sleep 10
79
to excute the script
./test.sh
80
automatically find the file's path by its name
find . -name toto -print
81
start search from currect location
explane . in find . -name toto -print
82
name of the file is toto
explane toto in find . -name toto -print
83
show the location (path) on the screen
explane -print in find . -name toto -print
84
location where there are files controlling the machines configuration like IP adress. It is one of the system directories.
cd /etc etc:
85
get detailed information about resolv.conf only
ls -rtl resolv.conf
86
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)
find / -name resolv.conf -print
87
show the output in pages because ( | more ) is used
find / -name resolv.conf -print | more
88
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
find / -name \*\*ress\*\* -print
89
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
find / -name \*\*ress\*\* -print \> toto
90
changes the password
passwd
91
opens a file
vi toto
92
to exit
:q
93
remove line
dd
94
removes 4 lines
4dd
95
undo
u
96
delete one character
x
97
insertion mode
i
98
insertion mode after the cursor
a
99
write in a new line
o
100
save in memory
:w
101
go to the end of the file
shift g
102
go to the begining of the file
1 shift g