I did not succeed in doing a shell script question, can anyone get a resolution? Or you can explain, I used grep cut awk and I could not do it anyway.
It has been made available a txt file, I will post it summarized:
rtkit 1207 0.0 183544 tty / 7 14:11 00:00 / usr / lib / rtkit / rtkit-daemon
root 1219 0.0 351272 tty / 7 14:11 00:00 / usr / lib / upower / upowerd
root 1263 0.0 0 tty / 7 14:11 00:00 krfcommd
user001 1276 0.0 45280 tty / 7 14:11 00:00 / lib / systemd / systemd
user001 1279 0.0 63240 tty / 7 14:11 00:00 (sd-pam)
user001 1284 0.0 209248 tty / 7 14:11 00:00 / usr / bin / gnome-keyring-daemon
user007 1286 0.0 50640 tty / 7 14:11 00:00 / sbin / upstart
root 1380 0.0 16128 tty / 7 14:11 00:00 / sbin / dhclient
nobody 1391 0.0 56900 tty / 7 14:11 00:00 / usr / sbin / dnsmasq
user001 1482 0.0 36896 tty / 7 14:11 00:00 upstart-udev-bridge
user001 1547 0.0 43924 tty / 7 14:11 00:00 dbus-daemon
For the following exercises, use the provided "data2019.txt" file. This file represents the programs running on a Linux system, containing, in each line, the following data:
User, Program ID,% CPU Used, Total Memory Used, Terminal, Start Time, Run Time, Program
In the file, each die is separated from the other by a space.
Question:
Write a shellscript that lists exactly how many subdirectories a user has in any directory received by parameter and report that quantity.
It has been made available a txt file, I will post it summarized:
rtkit 1207 0.0 183544 tty / 7 14:11 00:00 / usr / lib / rtkit / rtkit-daemon
root 1219 0.0 351272 tty / 7 14:11 00:00 / usr / lib / upower / upowerd
root 1263 0.0 0 tty / 7 14:11 00:00 krfcommd
user001 1276 0.0 45280 tty / 7 14:11 00:00 / lib / systemd / systemd
user001 1279 0.0 63240 tty / 7 14:11 00:00 (sd-pam)
user001 1284 0.0 209248 tty / 7 14:11 00:00 / usr / bin / gnome-keyring-daemon
user007 1286 0.0 50640 tty / 7 14:11 00:00 / sbin / upstart
root 1380 0.0 16128 tty / 7 14:11 00:00 / sbin / dhclient
nobody 1391 0.0 56900 tty / 7 14:11 00:00 / usr / sbin / dnsmasq
user001 1482 0.0 36896 tty / 7 14:11 00:00 upstart-udev-bridge
user001 1547 0.0 43924 tty / 7 14:11 00:00 dbus-daemon
For the following exercises, use the provided "data2019.txt" file. This file represents the programs running on a Linux system, containing, in each line, the following data:
User, Program ID,% CPU Used, Total Memory Used, Terminal, Start Time, Run Time, Program
In the file, each die is separated from the other by a space.
Question:
Write a shellscript that lists exactly how many subdirectories a user has in any directory received by parameter and report that quantity.