Professional Documents
Culture Documents
$ mkdir India
$ cd India
$ pwd
4) Create a File Notes.Txt using vi editor and add 20 city names and save the file.
$ vi File Notes.Txt
Marseille
Lyon
Toulouse
Nice
Dijon
Bordeaux
Strasbourg
Amiens
Troyes
Nantes
Marseille
Lyon
Toulouse
Nice
Dijon
Bordeaux
Strasbourg
Amiens
Troyes
Nantes
5) Check the default rights given to file :- Notes.Txt
$ ls –l Notes.txt
6) Give read and write permission for the file Notes.Txt for the owner of the file and
execute permission to the group and read permission to others.
$ ls –l Notes.txt
8) Copy the contents of the file Notes.txt in to a new file called Usa.Doc
$ cp Notes.txt Usa.Doc
9) Create a New file Using Vi Editor called Japan and after typing 5 lines do not save the
file and exit.
$ vi Japan
Wdw
Wewrw
Wwrw
Wwrw
Rwww
:q!
$ cd India
$ mkdir Skorea
11) Check the directory Skorea is created and the remove the directory.
$ ls
$ rmdir Skorea
12) List the number of users who are logged in.
$ who
$ cal 1 2019
14) Create a sub directory called Delhi, Jaipur , Jodhpur, Amritsar and Kolkatta under
India Directory.
$ cd India
$ mkdir Delhi
$ mkdir Jaipur
$ mkdir Amritsar
$ mkdir Kolkatta
15) Create a file called Oracle.txt using vi editor types the names of 10 types of
$ vi Oracle.txt
Java
Unix
Linux
C++
C#
SQL
MySQL
PLSql
Oracle
16) Copy the file oracle into sub directory called Jaipur.
$ cp Oracle.txt Jaipur
17) Staying in India directory read the file oracle in Jaipur directory.
$ cd India
$ cat /Jaipur/Oracle.txt
18) Within Jaipur create a subdirectory called Udaipur and within Udaipur create a sub
$ cd Jaipur
$ mkdir Udaipur
$ cd Udaipur
$mkdir California
19) Go to California directory and check the path and create a file called Jamesbond.py
$ cd California
$ pwd
$ cat Jamesbond.py
Java
Unix
Linux
C++
C#
SQL
MySQL
PLSql
Oracle
Java
Unix
Linux
C++
C#
SQL
MySQL
PLSql
Oracle
$ cp Jamesbond.py /home/user/India
21) Staying in California directory read the file Jamesbond.Py in India Directory
$ cat /home/user/India
$ mv Jamesbond.py Hollywood
$ sort Hollywood
$ sort –r Hollywood
$ who am i
26) Trying reading the file Hollywood without using cat /Vi editor.
$ view Hollywood
27) Jump to Udaipur Directory.
$ cd ..
28) In Udaipur Directory create 2 file one with your first name and other with your last
$ cat Revu
Revappa 5232
sujit 1231
giri 12134
iru 4253
kartik 5353
sandeep 4252
amar 4222
fyydg 224
bavya 41551
theru 1331
adarsh 1213
abhaya 1451
prakash 1441
praveen 4242
shankar 4524
chinnu 3151
amogh 6534
veeru 5425
manu 1323
akash 2324
anu 1313
abhi 1312
arya 3242
alap 1332
akshay 2424
Revappa 5232
sujit 1231
giri 12134
iru 4253
kartik 5353
sandeep 4252
amar 4222
fyydg 224
bavya 41551
theru 1331
adarsh 1213
abhaya 1451
prakash 1441
praveen 4242
shankar 4524
chinnu 3151
amogh 6534
veeru 5425
manu 1323
akash 2324
anu 1313
abhi 1312
arya 3242
alap 1332
akshay 2424
$ cat Mallapure
Revappa 5232
sujit 1231
giri 12134
iru 4253
kartik 5353
sandeep 4252
amar 4222
fyydg 224
bavya 41551
theru 1331
adarsh 1213
abhaya 1451
prakash 1441
praveen 4242
shankar 4524
chinnu 3151
amogh 6534
veeru 5425
manu 1323
akash 2324
anu 1313
abhi 1312
arya 3242
alap 1332
akshay 2424
Revappa 5232
sujit 1231
giri 12134
iru 4253
kartik 5353
sandeep 4252
amar 4222
fyydg 224
bavya 41551
theru 1331
adarsh 1213
abhaya 1451
prakash 1441
praveen 4242
shankar 4524
chinnu 3151
amogh 6534
veeru 5425
manu 1323
akash 2324
anu 1313
abhi 1312
arya 3242
alap 1332
akshay 2424
29) Read the file with your first name page wise.
$ cp Revu1
$ cp Revu2
$ cp Revu3
$ cp Revu4
$ cp Revu5
$ ls -l
$ ls A*
$ cat ?????
34) Make a copy of the file of your last name called Bangalore.txt
$ cp Mallapure Bangalore.txt
$ cp Bangalore.txt /home/user/India
Revappa 5232
sujit 1231
giri 12134
iru 4253
kartik 5353
sandeep 4252
amar 4222
fyydg 224
bavya 41551
theru 1331
adarsh 1213
abhaya 1451
37) Sort the file Bangalore and store it in a New file called Result.sh
38) Give full permission to owner and group of result.sh file and no permission to
others.
S head –n 19 Bangalore.txt
$ tail –n 24 Bangalore.txt
$ lp Bangalore.txt
42) Make a copy of the Bangalore file called Honkong in Amristar directory.
$ cp Bangalore.txt /home/user/India/Amritsar/Hangkong.txt
43) Get into Amritsar Directory and rename the file Honkong as China
$ cd Amritsar
$ mv Hangkong China
44) Make a copy of the file China as Kingkong
$ mv China Kingkong
$ rm –i Kingkong
$ ps
$ man cat
48) List the total number of lines and words in Bangalore file
$ wc Bangalore.txt
$ a=2
$ b=3
$ c=4
$ d=5
$ e=6
$ f=7
$ g=8
$ expr $a + $b + $c + $d + $e + $f + $g
$ expr $1 \* $2 \* $3 \* $4 \* $5 \* $6 \* $7
$ vi first.sh
clear
$ lpq
$ ps
$ kill 1234
$ mv China Shanghai.sh
$ sh Shanghai.sh