0% found this document useful (0 votes)
4 views5 pages

OS Lab

The document details a series of terminal commands executed by a user named Zahid, including creating a backup directory, manipulating file permissions, and using tar and gzip for file compression. It also covers the installation of the 'tree' package, setting up SSH, and transferring files using SCP. Finally, it shows commands for scheduling and canceling system shutdowns and reboots.

Uploaded by

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

OS Lab

The document details a series of terminal commands executed by a user named Zahid, including creating a backup directory, manipulating file permissions, and using tar and gzip for file compression. It also covers the installation of the 'tree' package, setting up SSH, and transferring files using SCP. Finally, it shows commands for scheduling and canceling system shutdowns and reboots.

Uploaded by

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

zahid@ASUS:~$ mkdir backup

zahid@ASUS:~$ cd backup
zahid@ASUS:~/backup$ touch [Link] [Link] [Link]
zahid@ASUS:~/backup$ ls -l
total 0
-rw-r--r-- 1 zahid zahid 0 Apr 26 20:55 [Link]
-rw-r--r-- 1 zahid zahid 0 Apr 26 20:55 [Link]
-rw-r--r-- 1 zahid zahid 0 Apr 26 20:55 [Link]
zahid@ASUS:~/backup$ chmod 600 [Link]
zahid@ASUS:~/backup$ chmod 777 [Link]
zahid@ASUS:~/backup$ chmod 644 [Link]
zahid@ASUS:~/backup$ ls -l
total 0
-rw------- 1 zahid zahid 0 Apr 26 20:55 [Link]
-rwxrwxrwx 1 zahid zahid 0 Apr 26 20:55 [Link]
-rw-r--r-- 1 zahid zahid 0 Apr 26 20:55 [Link]
zahid@ASUS:~/backup$ ■

zahid@ASUS:~$ cd backup
zahid@ASUS:~/backup$ tar -cvf folder_backup.tar *
[Link]
[Link]
[Link]
zahid@ASUS:~/backup$ gzip folder_backup.tar
zahid@ASUS:~/backup$ gunzip folder_backup.[Link]
zahid@ASUS:~/backup$ tar -xvf folder_backup.tar
[Link]
[Link]
[Link]
zahid@ASUS:~/backup$
zahid@ASUS:~$ sudo apt-get install tree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
tree
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
Need to get 47.4 kB of archives.
After this operation, 111 kB of additional disk space will be used.
Get:1 [Link] noble-updates/universe amd64 tree amd64
Fetched 47.4 kB in 1s (36.2 kB/s)
Selecting previously unselected package tree.
(Reading database ... 55440 files and directories currently installed.)
Preparing to unpack .../tree_2.1.1-2ubuntu3.24.04.2_amd64.deb ...
Unpacking tree (2.1.1-2ubuntu3.24.04.2) ...
Setting up tree (2.1.1-2ubuntu3.24.04.2) ...
Processing triggers for man-db (2.12.0-4build2) ...
zahid@ASUS:~$ tree
.
|-- Student
| |-- back1
| | |-- [Link]
| | |-- [Link]
| | `-- [Link]
| `-- [Link]
|-- [Link]
|-- back1
| |-- [Link]
| |-- [Link]
| `-- [Link]
|-- back2
|-- backup
| |-- [Link]
| |-- [Link]
| |-- [Link]
| `-- folder_backup.tar
|-- backup1
| |-- [Link]
| |-- folder_backup.[Link]
| |-- [Link]
| |-- [Link]
| `-- unzip_backup
| |-- [Link]
| |-- [Link]
| `-- [Link]
|-- [Link]
|-- check
| |-- [Link]
| |-- [Link]
| |-- [Link]
| `-- [Link]
|-- [Link]
|-- [Link].1
|-- my_backup
| `-- [Link]
zahid@ASUS:~$ ssh localhost
zahid@localhost's password:
Last login: Sun Apr 26 22:37:27 2026 from [Link]
zahid@ASUS:~$ sudo apt install openssh-server
[sudo] password for zahid:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openssh-server is already the newest version (1:9.6p1-3ubuntu13.15).
0 upgraded, 0 newly installed, 0 to remove and 98 not upgraded.
zahid@ASUS:~$ sudo service ssh start
zahid@ASUS:~$ pwd
/home/zahid
zahid@ASUS:~$ ls
ICT back1 backup1 [Link] program [Link]
Student back2 [Link] [Link].1 program.c
[Link] backup check my_backup [Link]
zahid@ASUS:~$ mkdir testSSH
zahid@ASUS:~$ exit
logout
Connection to localhost closed.
zahid@ASUS:~$ ■
zahid@ASUS:~$ echo "Hello SSH" >[Link]
zahid@ASUS:~$ mkdir SSHTest
zahid@ASUS:~$ scp [Link] zahid@localhost:~/SSHTest/
zahid@localhost's password:
[Link] 100% 10 13.1KB/s 00:00
zahid@ASUS:~$ ls SSHTest
[Link]
zahid@ASUS:~$ scp zahid@localhost:~/SSHTest/[Link]
usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]
[-i identity_file] [-J destination] [-l limit] [-o ssh_option]
[-P port] [-S program] [-X sftp_option] source ... target
zahid@ASUS:~$ ■

zahid@ASUS:~$ sudo shutdown -r +5


[sudo] password for zahid:
Reboot scheduled for Mon 2026-04-27 00:41:42 +06, use 'sh
utdown -c' to cancel.
zahid@ASUS:~$ sudo shutdown -h +20
Shutdown scheduled for Mon 2026-04-27 00:56:56 +06, use '
shutdown -c' to cancel.
zahid@ASUS:~$ sudo shutdown -c
zahid@ASUS:~$ sudo shutdown -h now
zahid@ASUS:~$ sud

[process exited with code 1 (0x00000001)]


You can now close this terminal with Ctrl+D, or press Ent
er to restart.

You might also like