-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLinuxExercise5
89 lines (48 loc) · 2.27 KB
/
LinuxExercise5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
##Run a command to see all the processes running on the server owned by everyone.
ps
##Confirm the username you are running as.
echo $USER
##Run a command to see all the processes running on the server and use grep to select only the processes your user is running.
ps -ef | grep "root"
##Repeat the previous exercise. This time, select every process except things running as you.
ps -ef | grep "jeff"
##Show the process info for our current session without using a grep command.
ps -ef
##Show the process tree for the current session.
pstree
##Run a process check on the server but only output the User, pid and cmd columns to your results.
ps -eo pid,cmd,user
##Run a process check to pull all of the process ids running on the server and put the output into a file named list in your home directory.
ps > /Users/Jeff/practice_sre_training/list
##Run the following series of commands:
--sleep 300 &
--Find this command by checking the processes and running a grep
ps grep 27176
--Stop the process using the process id
sudo kill -9 27176
--Run a command to see a dynamic view of all the processes running on your host.
btop
##Now run the same command but specifically only for root.
ps grep "root"
sudo kill -9 xxxxx
##Experiment with the following commands while running top and note your observations:
z - nothing happens
c - mode[n]: appears
Shift P - nothing happens
k - nothing happens
##Run a command to check network connectivity between your Linux session and yahoo.com.
ping yahoo.com
##show the network route between your session and yahoo.com and output the contents into a file named yahoo.route in your home directory.
traceroute yahoo.com > yahoo.route /home
##View the file using less and see how many hops it took to get there.
cat less yahoo.route
##Create a soft link named route to your network route.
ln -s yahoo.route route
##Run a command to see all the network sockets on your server and output to a file named output in your home directory.
ifconfig > output /home
##Create a folder named network in your home directory.
mkdir network
##Move your route file and network output file into the network folder you just created.
mv /home/output /home/network | mv /home/route /home/network
##Run the command to query your network interfaces on your session.
netstat