0% found this document useful (0 votes)
15 views

Assignment Unix Day 4 Assignment

Uploaded by

harshitasumit1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Assignment Unix Day 4 Assignment

Uploaded by

harshitasumit1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

root@ranjan18dec:~# cat /etc/os-release

NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@ranjan18dec:~#

top - 14:45:21 up 23:34, 1 user, load average: 0.00, 0.00, 0.00


Tasks: 101 total, 1 running, 100 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.2 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 3908.7 total, 2817.0 free, 214.3 used, 877.4 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 3461.0 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

21363 root 20 0 0 0 0 I 0.3 0.0 0:00.61 kworker/1:2-


events

1 root 20 0 169420 12708 8344 S 0.0 0.3 0:06.60 systemd

2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd

3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp

4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp

5 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 slub_flushwq

6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns

8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00


kworker/0:0H-events_highpri

10 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq

11 root 20 0 0 0 0 S 0.0 0.0 0:00.00


rcu_tasks_rude_

12 root 20 0 0 0 0 S 0.0 0.0 0:00.00


rcu_tasks_trace

13 root 20 0 0 0 0 S 0.0 0.0 0:00.08 ksoftirqd/0

14 root 20 0 0 0 0 I 0.0 0.0 0:01.44 rcu_sched

15 root rt 0 0 0 0 S 0.0 0.0 0:00.53 migration/0

16 root -51 0 0 0 0 S 0.0 0.0 0:00.00


idle_inject/0
18 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0

19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1

20 root -51 0 0 0 0 S 0.0 0.0 0:00.00


idle_inject/1

21 root rt 0 0 0 0 S 0.0 0.0 0:00.85 migration/1

22 root 20 0 0 0 0 S 0.0 0.0 0:00.11 ksoftirqd/1

24 root 0 -20 0 0 0 I 0.0 0.0 0:00.00


kworker/1:0H-events_highpri

25 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs

26 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 inet_frag_wq

27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd

29 root 20 0 0 0 0 S 0.0 0.0 0:00.04 khungtaskd

30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper

31 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback

32 root 20 0 0 0 0 S 0.0 0.0 0:04.25 kcompactd0

33 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd

34 root 39 19 0 0 0 S 0.0 0.0 0:00.00 khugepaged

80 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kintegrityd

81 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kblockd

82 root 0 -20 0 0 0 I 0.0 0.0 0:00.00


blkcg_punt_bio

83 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 tpm_dev_wq

84 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 ata_sff

85 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 md

86 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 edac-poller

87 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 devfreq_wq

88 root -51 0 0 0 0 S 0.0 0.0 0:00.00 watchdogd

90 root 0 -20 0 0 0 I 0.0 0.0 0:00.45


kworker/1:1H-kblockd

92 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0

93 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ecryptfs-


kthrea
95 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kthrotld

96 root 0 -20 0 0 0 I 0.0 0.0 0:00.00


acpi_thermal_pm

97 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0

98 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 scsi_tmf_0

99 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 nvme-wq

100 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 nvme-reset-


wq

101 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 nvme-delete-


wq

102 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 vfio-irqfd-


clea

104 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mld

105 root 0 -20 0 0 0 I 0.0 0.0 0:00.00


ipv6_addrconf

114 root 0 -20 0 0 0 I 0.0 0.0 0:00.26


kworker/0:1H-kblockd

115 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kstrp

root@ranjan18dec:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 2.3G 13G 16% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 391M 952K 390M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/loop0 64M 64M 0 100% /snap/core20/2434
/dev/loop1 375M 375M 0 100% /snap/google-cloud-cli/287
/dev/loop2 92M 92M 0 100% /snap/lxd/29619
/dev/loop3 39M 39M 0 100% /snap/snapd/21759
/dev/sda15 105M 6.1M 99M 6% /boot/efi
/dev/loop4 45M 45M 0 100% /snap/snapd/23258
tmpfs 391M 0 391M 0% /run/user/1001
root@ranjan18dec:~# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 2.3G 13G 16% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 391M 952K 390M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/loop0 64M 64M 0 100% /snap/core20/2434
/dev/loop1 375M 375M 0 100% /snap/google-cloud-cli/287
/dev/loop2 92M 92M 0 100% /snap/lxd/29619
/dev/loop3 39M 39M 0 100% /snap/snapd/21759
/dev/sda15 105M 6.1M 99M 6% /boot/efi
/dev/loop4 45M 45M 0 100% /snap/snapd/23258
tmpfs 391M 0 391M 0% /run/user/1001
root@ranjan18dec:~# free -m
total used free shared buff/cache available
Mem: 3908 215 2814 0 878 3459
Swap: 0 0 0
root@ranjan18dec:~# free -g
total used free shared buff/cache available
Mem: 3 0 2 0 0 3
Swap: 0 0 0
root@ranjan18dec:~# free -h
total used free shared buff/cache available
Mem: 3.8Gi 216Mi 2.7Gi 0.0Ki 878Mi 3.4Gi
Swap: 0B 0B 0B
root@ranjan18dec:~# du
4 ./snap/lxd/29619
4 ./snap/lxd/common
12 ./snap/lxd
16 ./snap
4 ./.ssh
4 ./.config/procps
8 ./.config
40 .
root@ranjan18dec:~# uptime
14:53:32 up 23:43, 1 user, load average: 0.00, 0.00, 0.00
root@ranjan18dec:~# last
harshita pts/0 172.217.41.168 Thu Dec 19 14:38 still logged in
harshita pts/0 172.217.41.168 Thu Dec 19 13:58 - 14:22 (00:24)
harshita pts/0 35.235.241.16 Wed Dec 18 15:26 - 15:38 (00:12)
reboot system boot 5.15.0-1071-gcp Wed Dec 18 15:10 still running

wtmp begins Wed Dec 18 15:10:24 2024


root@ranjan18dec:~# ps -ef | grep -i "java"
root 24183 23423 0 14:54 pts/0 00:00:00 grep --color=auto -i java
root@ranjan18dec:~# ^C
root@ranjan18dec:~# ^C
root@ranjan18dec:~# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Dec18 ? 00:00:06 /sbin/init
root 2 0 0 Dec18 ? 00:00:00 [kthreadd]
root 3 2 0 Dec18 ? 00:00:00 [rcu_gp]
root 4 2 0 Dec18 ? 00:00:00 [rcu_par_gp]
root 5 2 0 Dec18 ? 00:00:00 [slub_flushwq]
root 6 2 0 Dec18 ? 00:00:00 [netns]
root 8 2 0 Dec18 ? 00:00:00 [kworker/0:0H-events_highpri]
root 10 2 0 Dec18 ? 00:00:00 [mm_percpu_wq]
root 11 2 0 Dec18 ? 00:00:00 [rcu_tasks_rude_]
root 12 2 0 Dec18 ? 00:00:00 [rcu_tasks_trace]
root 13 2 0 Dec18 ? 00:00:00 [ksoftirqd/0]
root 14 2 0 Dec18 ? 00:00:01 [rcu_sched]
root 15 2 0 Dec18 ? 00:00:00 [migration/0]
root 16 2 0 Dec18 ? 00:00:00 [idle_inject/0]
root 18 2 0 Dec18 ? 00:00:00 [cpuhp/0]
root 19 2 0 Dec18 ? 00:00:00 [cpuhp/1]
root 20 2 0 Dec18 ? 00:00:00 [idle_inject/1]
root 21 2 0 Dec18 ? 00:00:00 [migration/1]
root 22 2 0 Dec18 ? 00:00:00 [ksoftirqd/1]
root 24 2 0 Dec18 ? 00:00:00 [kworker/1:0H-events_highpri]
root 25 2 0 Dec18 ? 00:00:00 [kdevtmpfs]
root 26 2 0 Dec18 ? 00:00:00 [inet_frag_wq]
root 27 2 0 Dec18 ? 00:00:00 [kauditd]
root 29 2 0 Dec18 ? 00:00:00 [khungtaskd]
root 30 2 0 Dec18 ? 00:00:00 [oom_reaper]
root 31 2 0 Dec18 ? 00:00:00 [writeback]
root 32 2 0 Dec18 ? 00:00:04 [kcompactd0]
root 33 2 0 Dec18 ? 00:00:00 [ksmd]
root 34 2 0 Dec18 ? 00:00:00 [khugepaged]
root 80 2 0 Dec18 ? 00:00:00 [kintegrityd]
root 81 2 0 Dec18 ? 00:00:00 [kblockd]
root 82 2 0 Dec18 ? 00:00:00 [blkcg_punt_bio]
root 83 2 0 Dec18 ? 00:00:00 [tpm_dev_wq]
root 84 2 0 Dec18 ? 00:00:00 [ata_sff]
root 85 2 0 Dec18 ? 00:00:00 [md]
root 86 2 0 Dec18 ? 00:00:00 [edac-poller]
root 87 2 0 Dec18 ? 00:00:00 [devfreq_wq]
root 88 2 0 Dec18 ? 00:00:00 [watchdogd]
root 90 2 0 Dec18 ? 00:00:00 [kworker/1:1H-kblockd]
root 92 2 0 Dec18 ? 00:00:00 [kswapd0]
root 93 2 0 Dec18 ? 00:00:00 [ecryptfs-kthrea]
root 95 2 0 Dec18 ? 00:00:00 [kthrotld]
root 96 2 0 Dec18 ? 00:00:00 [acpi_thermal_pm]
root 97 2 0 Dec18 ? 00:00:00 [scsi_eh_0]
root 98 2 0 Dec18 ? 00:00:00 [scsi_tmf_0]
root 99 2 0 Dec18 ? 00:00:00 [nvme-wq]
root 100 2 0 Dec18 ? 00:00:00 [nvme-reset-wq]
root 101 2 0 Dec18 ? 00:00:00 [nvme-delete-wq]
root 102 2 0 Dec18 ? 00:00:00 [vfio-irqfd-clea]
root 104 2 0 Dec18 ? 00:00:00 [mld]
root 105 2 0 Dec18 ? 00:00:00 [ipv6_addrconf]
root 114 2 0 Dec18 ? 00:00:00 [kworker/0:1H-kblockd]
root 115 2 0 Dec18 ? 00:00:00 [kstrp]
root 119 2 0 Dec18 ? 00:00:00 [zswap-shrink]
root 120 2 0 Dec18 ? 00:00:00 [kworker/u5:0]
root 127 2 0 Dec18 ? 00:00:00 [charger_manager]
root 128 2 0 Dec18 ? 00:00:00 [jbd2/sda1-8]
root 129 2 0 Dec18 ? 00:00:00 [ext4-rsv-conver]
root 130 2 0 Dec18 ? 00:00:00 [hwrng]
root 168 1 0 Dec18 ? 00:00:05 /lib/systemd/systemd-journald
root 206 1 0 Dec18 ? 00:00:00 /lib/systemd/systemd-udevd
root 231 2 0 Dec18 ? 00:00:00 [cryptd]
root 330 2 0 Dec18 ? 00:00:00 [kaluad]
root 331 2 0 Dec18 ? 00:00:00 [kmpath_rdacd]
root 333 2 0 Dec18 ? 00:00:00 [kmpathd]
root 334 2 0 Dec18 ? 00:00:00 [kmpath_handlerd]
root 335 1 0 Dec18 ? 00:00:09 /sbin/multipathd -d -s
systemd+ 452 1 0 Dec18 ? 00:00:00 /lib/systemd/systemd-networkd
systemd+ 455 1 0 Dec18 ? 00:00:00 /lib/systemd/systemd-resolved
root 566 1 0 Dec18 ? 00:00:03
/usr/lib/accountsservice/accounts-daemon
message+ 582 1 0 Dec18 ? 00:00:00 /usr/bin/dbus-daemon --system
--address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root 593 1 0 Dec18 ? 00:00:12 /usr/bin/google_osconfig_agent
root 608 1 0 Dec18 ? 00:00:00 /usr/bin/python3
/usr/bin/networkd-dispatcher --run-startup-triggers
syslog 610 1 0 Dec18 ? 00:00:01 /usr/sbin/rsyslogd -n -iNONE
daemon 629 1 0 Dec18 ? 00:00:00 /usr/sbin/atd -f
root 757 1 0 Dec18 ? 00:00:10 /usr/bin/google_guest_agent
root 842 1 0 Dec18 ? 00:00:00 /usr/lib/policykit-1/polkitd --
no-debug
root 847 1 0 Dec18 ? 00:00:00 /usr/bin/python3
/usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root 855 1 0 Dec18 ttyS0 00:00:00 /sbin/agetty -o -p -- \u --
keep-baud 115200,38400,9600 ttyS0 vt220
root 859 1 0 Dec18 tty1 00:00:00 /sbin/agetty -o -p -- \u --
noclear tty1 linux
root 860 1 0 Dec18 ? 00:00:03 sshd: /usr/sbin/sshd -D
[listener] 0 of 10-100 startups
root 865 1 0 Dec18 ? 00:00:00 /lib/systemd/systemd-logind
root 870 1 0 Dec18 ? 00:00:00 /usr/sbin/cron -f
_chrony 1285 1 0 Dec18 ? 00:00:00 /usr/sbin/chronyd -F -1
_chrony 1286 1285 0 Dec18 ? 00:00:00 /usr/sbin/chronyd -F -1
root 3540 1 0 Dec18 ? 00:00:04 /usr/lib/snapd/snapd
root 21305 2 0 09:22 ? 00:00:02 [kworker/0:0-mm_percpu_wq]
root 21363 2 0 09:33 ? 00:00:00 [kworker/1:2-mm_percpu_wq]
root 23201 2 0 14:28 ? 00:00:00 [kworker/1:1-events]
root 23204 2 0 14:29 ? 00:00:00 [kworker/u4:0-events_unbound]
root 23297 2 0 14:34 ? 00:00:00 [kworker/u4:2-
events_power_efficient]
root 23312 2 0 14:38 ? 00:00:00 [kworker/0:1-cgroup_destroy]
root 23323 860 0 14:38 ? 00:00:00 sshd: harshitasumit1 [priv]
harshit+ 23330 1 0 14:38 ? 00:00:00 /lib/systemd/systemd --user
harshit+ 23331 23330 0 14:38 ? 00:00:00 (sd-pam)
harshit+ 23407 23323 0 14:38 ? 00:00:00 sshd: harshitasumit1@pts/0
harshit+ 23408 23407 0 14:38 pts/0 00:00:00 -bash
root 23420 2 0 14:40 ? 00:00:00 [kworker/u4:1-events_unbound]
root 23422 23408 0 14:41 pts/0 00:00:00 sudo -i
root 23423 23422 0 14:41 pts/0 00:00:00 -bash
root 24186 23423 0 14:57 pts/0 00:00:00 ps -ef
root@ranjan18dec:~# ps -ef | grep kmsd
root 24190 23423 0 14:57 pts/0 00:00:00 grep --color=auto kmsd
root@ranjan18dec:~# ping
ping: usage error: Destination address required
root@ranjan18dec:~# ping www.goggle.com
ping: www.goggle.com: Name or service not known
root@ranjan18dec:~# ping www.google.com
PING www.google.com (142.251.183.104) 56(84) bytes of data.
64 bytes from yucbfaa-in-f104.1e100.net (142.251.183.104): icmp_seq=1 ttl=115
time=3.40 ms
64 bytes from yucbfaa-in-f104.1e100.net (142.251.183.104): icmp_seq=2 ttl=115
time=1.11 ms
64 bytes from yucbfaa-in-f104.1e100.net (142.251.183.104): icmp_seq=3 ttl=115
time=1.23 ms
64 bytes from yucbfaa-in-f104.1e100.net (142.251.183.104): icmp_seq=4 ttl=115
time=1.04 ms
64 bytes from yucbfaa-in-f104.1e100.net (142.251.183.104): icmp_seq=5 ttl=115
time=1.13 ms
64 bytes from yucbfaa-in-f104.1e100.net (142.251.183.104): icmp_seq=6 ttl=115
time=1.15 ms
^C
--- www.google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 1.040/1.510/3.397/0.845 ms
root@ranjan18dec:~# nsklookup 142.251.183.104

Command 'nsklookup' not found, did you mean:

command 'nslookup' from deb bind9-dnsutils (1:9.18.28-0ubuntu0.20.04.1)


Try: apt install <deb name>

root@ranjan18dec:~# dig google.com

; <<>> DiG 9.18.28-0ubuntu0.20.04.1-Ubuntu <<>> google.com


;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53218
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 300 IN A 172.217.214.100
google.com. 300 IN A 172.217.214.139
google.com. 300 IN A 172.217.214.113
google.com. 300 IN A 172.217.214.138
google.com. 300 IN A 172.217.214.102
google.com. 300 IN A 172.217.214.101

;; Query time: 4 msec


;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Dec 19 15:03:07 UTC 2024
;; MSG SIZE rcvd: 135

root@ranjan18dec:~# nslookup google.com


Server: 127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: google.com
Address: 172.217.214.101
Name: google.com
Address: 172.217.214.102
Name: google.com
Address: 172.217.214.138
Name: google.com
Address: 172.217.214.113
Name: google.com
Address: 172.217.214.139
Name: google.com
Address: 172.217.214.100
Name: google.com
Address: 2607:f8b0:4001:c1e::64
Name: google.com
Address: 2607:f8b0:4001:c1e::8b
Name: google.com
Address: 2607:f8b0:4001:c1e::65
Name: google.com
Address: 2607:f8b0:4001:c1e::8a

You might also like