Practical 1 A
Practical 1 A
Roll No:- 41
Batch:-B
Subject:-OS LAB
Practical:- 1-A
Title-Study of Basic Linux Commands: echo, ls, read, cat, touch, test, loops,
arithmetic
comparison, conditional loops, grep, sed etc.
===================================================================================
=====================
student@student-HP-Pro-3330-MT:~$ pwd
/home/student
student@student-HP-Pro-3330-MT:~$ cd /
student@student-HP-Pro-3330-MT:/$ pwd
/
student@student-HP-Pro-3330-MT:/$ cd /Home
bash: cd: /Home: No such file or directory
student@student-HP-Pro-3330-MT:/$ cd Home/
bash: cd: Home/: No such file or directory
student@student-HP-Pro-3330-MT:/$ cd
student@student-HP-Pro-3330-MT:~$ pwd
/home/student
student@student-HP-Pro-3330-MT:~$ ls
anjali Desktop func.c Nishant_67 pr132.c Templates
a.out Documents hgh p1.cpp pr.c Videos
dd DopeChick.c Jagruti Pictures pr_H15.c
deepaligeet.sh Downloads Music pr131.c Public
demo examples.desktop newaddress pr132 raj42
student@student-HP-Pro-3330-MT:~$ ls Desktop/
deepaligeet.sh TE-IT-21
student@student-HP-Pro-3330-MT:~$ ls /
bin dev initrd.img lib64 mnt root snap tmp vmlinuz
boot etc initrd.img.old lost+found opt run srv usr vmlinuz.old
cdrom home lib media proc sbin sys var
student@student-HP-Pro-3330-MT:~$ ls ~
anjali Desktop func.c Nishant_67 pr132.c Templates
a.out Documents hgh p1.cpp pr.c Videos
dd DopeChick.c Jagruti Pictures pr_H15.c
deepaligeet.sh Downloads Music pr131.c Public
demo examples.desktop newaddress pr132 raj42
student@student-HP-Pro-3330-MT:~$
student@student-HP-Pro-3330-MT:~$ ls -l
total 120
drwxrwxr-x 2 student student 4096 May 30 15:25 anjali
-rwxrwxr-x 1 student student 8720 Mar 13 13:17 a.out
-rw-rw-r-- 1 student student 103 Jul 27 14:51 dd
-rwxrwxr-x 1 student student 1539 Jul 27 14:46 deepaligeet.sh
drwxrwxr-x 3 student student 4096 Jul 24 14:04 demo
drwxr-xr-x 2 student student 4096 Jul 31 13:29 Desktop
drwxr-xr-x 2 student student 4096 Nov 22 2022 Documents
-rw-rw-r-- 1 student student 1743 Feb 4 12:07 DopeChick.c
drwxr-xr-x 3 student student 4096 Jul 24 13:28 Downloads
-rw-r--r-- 1 student student 8980 Feb 15 2020 examples.desktop
-rw-rw-r-- 1 student student 84 Feb 21 16:44 func.c
-rw-rw-r-- 1 student student 47 Jul 27 14:45 hgh
drwxrwxr-x 2 student student 4096 Mar 9 13:15 Jagruti
drwxr-xr-x 2 student student 4096 Feb 15 2020 Music
-rw-rw-r-- 1 student student 0 Jul 31 13:17 newaddress
drwxrwxr-x 2 student student 4096 Jul 26 14:51 Nishant_67
-rw-rw-r-- 1 student student 747 May 17 12:08 p1.cpp
drwxr-xr-x 2 student student 4096 Feb 15 2020 Pictures
-rw-rw-r-- 1 student student 1291 Jan 14 2023 pr131.c
-rw-rw-r-- 1 student student 687 Jan 21 2023 pr132
-rw-rw-r-- 1 student student 757 Jan 21 2023 pr132.c
-rw-rw-r-- 1 student student 102 Dec 17 2022 pr.c
-rw-rw-r-- 1 student student 548 Feb 4 10:37 pr_H15.c
drwxr-xr-x 2 student student 4096 Feb 15 2020 Public
drwxrwxr-x 2 student student 4096 Jul 28 14:54 raj42
drwxr-xr-x 2 student student 4096 Feb 15 2020 Templates
drwxr-xr-x 2 student student 4096 Feb 15 2020 Videos
student@student-HP-Pro-3330-MT:~$ man
What manual page do you want?
student@student-HP-Pro-3330-MT:~$ cd
student@student-HP-Pro-3330-MT:~$ pwd
/home/student
student@student-HP-Pro-3330-MT:~$ mkdir
mkdir: missing operand
Try 'mkdir --help' for more information.
student@student-HP-Pro-3330-MT:~$ mkdir deepali
student@student-HP-Pro-3330-MT:~$ cd deepali/
student@student-HP-Pro-3330-MT:~/deepali$ cat file1
cat: file1: No such file or directory
student@student-HP-Pro-3330-MT:~/deepali$ touch file1
student@student-HP-Pro-3330-MT:~/deepali$ cat file1
student@student-HP-Pro-3330-MT:~/deepali$ cat > file1
hell this is first os pr
os commands
student@student-HP-Pro-3330-MT:~/deepali$ cat file1
hell this is first os pr
os commands
deepali@DESKTOP-50SN34U:~$ pwd
/home/deepali
deepali@DESKTOP-50SN34U:~$ touch pr1.txt
deepali@DESKTOP-50SN34U:~$ cat pr1.txt
deepali@DESKTOP-50SN34U:~$ cat >pr1.txt
by using the touch command only empty file is created and by using cat command we
add contents in the file
clt + D is for save the file
deepali@DESKTOP-50SN34U:~$ cat pr1.txt
by using the touch command only empty file is created and by using cat command we
add contents in the file
clt + D is for save the file
deepali@DESKTOP-50SN34U:~/TEOS$ vi testex.sh
deepali@DESKTOP-50SN34U:~/TEOS$ sh testex.sh
file is exist
deepali@DESKTOP-50SN34U:~/TEOS$ vi forex.sh
deepali@DESKTOP-50SN34U:~/TEOS$ sh forex.sh
1
2
3
4
5
deepali@DESKTOP-50SN34U:~/TEOS$ vi whileex.sh
deepali@DESKTOP-50SN34U:~/TEOS$ sh whileex.sh
number 5
number 4
number 3
number 2
number 1
deepali@DESKTOP-50SN34U:~/TEOS$ vi arithex.sh
deepali@DESKTOP-50SN34U:~/TEOS$ sh arithex.sh
5 is less then 10
5 is equal to 5
5 is not equal to 10
5 is not equal to 10
deepali@DESKTOP-50SN34U:~/TEOS$