Ads

Tuesday 13 August 2013

Operating System and Administration - Assignment 1

The output of the various commands used in the first assignment can be downloaded from the link given below

https://docs.google.com/file/d/0B3int2YK7n1HYURPWTN0RER0ek0/edit


1.Once u go to Google docs for downloading press  "Cltr + S" or just copy the code on any text file.
2.Change my name according to the preferred alternative

or just copy this
FILE HANDLING COMMANDS

cat command--------------------------------------------------------------

[oslab@306-A-009 ~]$ mkdir venky
[oslab@306-A-009 ~]$ cd venky
[oslab@306-A-009 ~/venky] $ cat > a.txt
alksnkasnkfmnk
^C
[oslab@306-A-009 ~/venky] $ ls
a.txt
[oslab@306-A-009 ~/venky] $ cat > b.txt
;ndsknliponfkdnk dn
mskfmkdmsklgm
^C
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt

wc command---------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ cat > a.txt
this is a txt document
this is written using cat command
this is wriiten in terminal
^C
[oslab@306-A-009 ~/venky] $ wc -c a.txt
84 a.txt
[oslab@306-A-009 ~/venky] $ wc -m a.txt
84 a.txt
[oslab@306-A-009 ~/venky] $ wc -l a.txt
3 a.txt
[oslab@306-A-009 ~/venky] $ wc -w a.txt
16 a.txt
[oslab@306-A-009 ~/venky] $ wc a.txt
3 16 84 a.txt

ls command---------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt
[oslab@306-A-009 ~/venky] $ mkdir v
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt  v

grep command-------------------------------------------------------------

[oslab@306-A-009 ~/venky/v] $ grep i a.txt
this is a txt document
this is written using cat command
this is wriiten in terminal
[oslab@306-A-009 ~/venky/v] $ grep -c i a.txt
3
[oslab@306-A-009 ~/venky/v] $ grep -i i a.txt
this is a txt document
this is written using cat command
this is wriiten in terminal
[oslab@306-A-009 ~/venky/v] $ grep -l i a.txt
a.txt
[oslab@306-A-009 ~/venky/v] $ grep -n i a.txt
1:this is a txt document
2:this is written using cat command
3:this is wriiten in terminal
[oslab@306-A-009 ~/venky/v] $ grep -v w a.txt
this is a txt document
[oslab@306-A-009 ~/venky/v] $ grep -w cat a.txt
this is written using cat command
[oslab@306-A-009 ~/venky/v] $ grep -w this a.txt
this is a txt document
this is wriiten in terminal

mv command---------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt  v
[oslab@306-A-009 ~/venky] $ mv a.txt v
[oslab@306-A-009 ~/venky] $ ls
b.txt  v
[oslab@306-A-009 ~/venky] $ cd v
[oslab@306-A-009 ~/venky/v] $ ls
a.txt  b.txt

rm command---------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ cat > c.txt
sadksamdk
^C
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt  c.txt
[oslab@306-A-009 ~/venky] $ rm c.txt
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt

cp command---------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ mkdir v
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt  v
[oslab@306-A-009 ~/venky] $ cp b.txt v
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt  v
[oslab@306-A-009 ~/venky] $ cd v
[oslab@306-A-009 ~/venky/v] $ ls
b.txt
[oslab@306-A-009 ~/venky/v] $ cd ..

chmod command------------------------------------------------------------

[oslab@306-A-009 ~/venky/v] $ ls -l
total 8
-rw-r--r-- 1 venky venky 84 Aug 13 12:40 a.txt
-rw-r--r-- 1 venky venky 34 Aug 13 12:44 b.txt
[oslab@306-A-009 ~/venky/v] $ chmod 750 a.txt
[oslab@306-A-009 ~/venky/v] $ ls -l
total 8
-rwxr-x--- 1 venky venky 84 Aug 13 12:40 a.txt
-rw-r--r-- 1 venky venky 34 Aug 13 12:44 b.txt
[oslab@306-A-009 ~/venky/v] $ chmod 462 a.txt
[oslab@306-A-009 ~/venky/v] $ ls -l
total 8
-r--rw--w- 1 venky venky 84 Aug 13 12:40 a.txt
-rw-r--r-- 1 venky venky 34 Aug 13 12:44 b.txt
[oslab@306-A-009 ~/venky/v] $ chmod 777 a.txt
[oslab@306-A-009 ~/venky/v] $ ls -l
total 8
-rwxrwxrwx 1 venky venky 84 Aug 13 12:40 a.txt
-rw-r--r-- 1 venky venky 34 Aug 13 12:44 b.txt





DIRECTORY HANDLING COMMANDS

mkdir command------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt
[oslab@306-A-009 ~/venky] $ mkdir v
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt v

rmdir command------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt  v
[oslab@306-A-009 ~/venky] $ rmdir v
[oslab@306-A-009 ~/venky] $ ls
a.txt  b.txt

cd command---------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ cd v
[oslab@306-A-009 ~/venky/v] $ cd ..

pwd command--------------------------------------------------------------

[oslab@306-A-009 ~/venky] $ pwd
/home/venky/venky

CREDITS --Venkatesh Lokare

No comments:

Post a Comment