Needs some Help with this command for Linux Operations Systems Display the compl
ID: 3802357 • Letter: N
Question
Needs some Help with this command for Linux Operations Systems
Display the complete command that will accomplish the following actions. (ie. If you were asked to extract the second column of information from a file called “food” you would display the following: cut –f2 food (NOT just the word cut))
1. What command will start a utility that allows you to audit system performance and updates the display every minute?
2. What command allows you to determine which users have processes running on your system?
3. If you are logged in as root go ahead and log out of root and back in to your own account. Type the command to determine the PID of your Bash shell session.
4. What command allows you to run the man program with the argument df in the background?
What command can you use to record the PID of the background process you just started?
What is the process ID you recorded? What command will terminate this process? (3 points)
5. Start the following two processes in the background by executing these commands:
cat /dev/tty > /dev/null &
cat /dev/zero > /dev/null &
What command would you use to bring the second job into the foreground?
What command would you use to terminate this foreground process?
What command would you use to terminate the first background process without bringing it into the foreground to do so?
6. What command would you use to find out which libraries are linked to the /bin/znew executable program?
When you ran this command what message did you receive on the console?
Explanation / Answer
Please find answers. I have given examples etc.
1. top -d 60
Example:
weblogic@david:/export/home/weblogic> top -d 60
top - 12:23:52 up 8 days, 7:20, 1 user, load average: 0.21, 0.41, 0.49
Tasks: 116 total, 2 running, 114 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.1%sy, 0.0%ni, 99.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 15953M total, 6215M used, 9738M free, 90M buffers
Swap: 18437M total, 11M used, 18426M free, 2481M cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18780 weblogic 20 0 8819m 3.3g 72m S 2 21.4 20:23.34 java
8122 gdm 20 0 243m 18m 12m S 0 0.1 1:03.26 gdm-simple-gree
8055 root 20 0 151m 21m 7124 S 0 0.1 0:41.98 X
10931 root 20 0 0 0 0 S 0 0.0 0:02.46 kworker/0:2
20 root RT 0 0 0 0 S 0 0.0 0:17.57 watchdog/3
32 root 39 19 0 0 0 S 0 0.0 1:36.36 khugepaged
1453 haldaemo 20 0 34320 2540 1764 S 0 0.0 0:05.32 hald
1583 root 20 0 34756 1164 1112 S 0 0.0 0:16.91 hald-addon-stor
2666 root 20 0 6580 504 380 S 0 0.0 1:41.86 irqbalance
8116 gdm 20 0 225m 10m 6948 S 0 0.1 0:01.42 gnome-power-man
18631 root 20 0 0 0 0 S 0 0.0 0:05.77 kworker/2:1
1 root 20 0 10540 684 652 S 0 0.0 0:10.51 init
2 root 20 0 0 0 0 S 0 0.0 1:05.93 kthreadd
3 root 20 0 0 0 0 S 0 0.0 0:04.23 ksoftirqd/0
6 root RT 0 0 0 0 S 0 0.0 0:18.95 migration/0
7 root RT 0 0 0 0 S 0 0.0 0:25.51 watchdog/0
8 root RT 0 0 0 0 S 0 0.0 0:14.98 migration/1
10 root 20 0 0 0 0 S 0 0.0 0:03.58 ksoftirqd/1
12 root RT 0 0 0 0 S 0 0.0 0:21.02 watchdog/1
13 root RT 0 0 0 0 S 0 0.0 0:16.32 migration/2
15 root 20 0 0 0 0 S 0 0.0 0:02.27 ksoftirqd/2
16 root RT 0 0 0 0 S 0 0.0 0:15.93 watchdog/2
17 root RT 0 0 0 0 S 0 0.0 0:18.39 migration/3
19 root 20 0 0 0 0 S 0 0.0 0:02.40 ksoftirqd/3
21 root 0 -20 0 0 0 S 0 0.0 0:00.00 cpuset
22 root 0 -20 0 0 0 S 0 0.0 0:00.00 khelper
23 root 0 -20 0 0 0 S 0 0.0 0:00.00 netns
24 root 20 0 0 0 0 S 0 0.0 0:06.92 sync_supers
25 root 20 0 0 0 0 S 0 0.0 0:00.04 bdi-default
2.
Note: a mean list the processes of all users, u provide information about each process, x lists processes that have no controlling terminal
3. echo $$
Example:
weblogic@david:/export/home/weblogic> echo $$
12787
4. Command to run with df argument in background:
man df &
Command to record the PID of the background process just started:
ps axf | grep "man df" | grep -v grep | awk '{print $1}'
Process id recorded: 13381
Example:
weblogic@david:/export/home/weblogic> ps axf | grep "man df" | grep -v grep | awk '{print $1}'
13381
Command to kill this process: kill -9 13381
5.
Command to bring the second job into the foreground? fg %2
Command to terminate this foreground process? Ctrl + C
Command to terminate the first background process without bringing it into the foreground to do so? kill %1
6. Command to find out which libraries are linked to the /bin/znew executable program:
ldd /bin/znew
Output:
weblogic@david:/export/home/weblogic> ldd /bin/znew
ldd: /bin/znew: No such file or directory
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.