0% found this document useful (0 votes)
6 views6 pages

431 Assignment2(OSL)

The document contains a series of UNIX command line operations performed by a user, including file creation, copying, moving, and permission changes. It demonstrates various commands such as 'cat', 'ls', 'mkdir', 'cp', 'mv', and 'chmod' along with their outputs. The user also utilizes commands for file comparison and manipulation, showcasing basic file management in a UNIX environment.

Uploaded by

meemee0101000
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)
6 views6 pages

431 Assignment2(OSL)

The document contains a series of UNIX command line operations performed by a user, including file creation, copying, moving, and permission changes. It demonstrates various commands such as 'cat', 'ls', 'mkdir', 'cp', 'mv', and 'chmod' along with their outputs. The user also utilizes commands for file comparison and manipulation, showcasing basic file management in a UNIX environment.

Uploaded by

meemee0101000
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
You are on page 1/ 6

Assignment 2

(UNIX Commands)
UCE2023431
Eesha Kamath
A2

localhost:~$ cat
assignment
assignment

z + tab tab
localhost:~$ z
zcat zdiff zfgrep zgrep zmore zramctl zsh-5.8
zcmp zegrep zforce zless znew zsh

localhost:~$ cat upload.txt


this is a text file with name "upload" to be uploaded
.

localhost:~$ ls /
bin etc lib mnt proc run srv tmp var
dev home media opt root sbin sys usr
localhost:~$ ls -F /
bin/ etc/ lib/ mnt/ proc/ run/ srv/ tmp/ var/
dev/ home/ media/ opt/ root/ sbin/ sys/ usr/

localhost:~$ ls -l
total 8
-rw------- 1 eeshakam root 18 Jan 8 15:09 text.txt
-rw------- 1 eeshakam root 58 Jan 8 15:22 upload.txt
-rw------- 1 eeshakam root 0 Jan 8 15:06 word.docx

localhost:~$ pwd
/home/eeshakamath11

localhost:/home$ pwd
/home
localhost:/home$

localhost:/home$ cd /home/eeshakamath11
localhost:~$ pwd
/home/eeshakamath11
localhost:~$ mkdir new
localhost:~$ cd new
localhost:~/new$

localhost:~/new$ cd /home/eeshakamath11
localhost:~$ cp upload.txt word.docx
localhost:~$ cat word.docx
this is a text file with name "upload" to be uploaded
.

localhost:~$ rm text.txt
localhost:~$ ls -l
total 12
drwxr-xr-x 2 eeshakam user2 37 Jan 8 15:33 new
-rw------- 1 eeshakam root 58 Jan 8 15:22 upload.txt
-rw------- 1 eeshakam user2 58 Jan 8 15:36 word.docx

localhost:~$ rmdir new


localhost:~$ ls -l
total 8
-rw------- 1 eeshakam root 58 Jan 8 15:22 upload.txt
-rw------- 1 eeshakam user2 58 Jan 8 15:36 word.docx

localhost:~$ mkdir new_folder


localhost:~$ mv word.docx new_folder
localhost:~$ cd new_folder
localhost:~/new_folder$ ls -l
total 4
-rw------- 1 eeshakam user2 58 Jan 8 15:36 word.docx

localhost:~/new_folder$ cd /home/eeshakamath11
localhost:~$ ls -l
total 8
drwxr-xr-x 2 eeshakam user2 63 Jan 8 15:41 new_folder
-rw------- 1 eeshakam root 58 Jan 8 15:22 upload.txt

localhost:~$ touch upload.txt


localhost:~$ ls -l
total 8
drwxr-xr-x 2 eeshakam user2 63 Jan 8 15:41 new_folder
-rw------- 1 eeshakam root 58 Jan 8 15:50 upload.txt
localhost:~$ touch newfile.txt
localhost:~$ ls -l
total 8
drwxr-xr-x 2 eeshakam user2 63 Jan 8 15:41 new_folder
-rw-r--r-- 1 eeshakam user2 0 Jan 8 15:51 newfile.txt
-rw------- 1 eeshakam root 58 Jan 8 15:50 upload.txt
localhost:~$ chmod 754 upload.txt
localhost:~$ ls -l
total 8
drwxr-xr-x 2 eeshakam user2 63 Jan 8 15:41 new_folder
-rw-r--r-- 1 eeshakam user2 0 Jan 8 15:51 newfile.txt
-rwxr-xr-- 1 eeshakam root 58 Jan 8 15:50 upload.txt

localhost:~$ du
20 ./.vfsync
8 ./new_folder
40 .
localhost:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 5120000 2417736 2702264 47% /
devtmpfs 93464 0 93464 0% /dev
tmpfs 93620 4 93616 0% /run
none 93620 0 93620 0% /dev/shm
localhost:~$ uptime

localhost:~$ who
/bin/sh: who: not found
localhost:~$ who am i
/bin/sh: who: not found

localhost:~$ cat upload.txt


this is a text file with name "upload" to be uploaded
.

localhost:~$ cat -n upload.txt


1 this is a text file with name "upload" to be uploaded
2 .
localhost:~$ cat -A upload.txt
this is a text file with name "upload" to be uploaded^M$
.^M$
localhost:~$ cat -nA upload.txt
1 this is a text file with name "upload" to be uploaded^M$
2 .^M$

localhost:~$ more -l +1 upload.txt


this is a text file with name "upload" to be uploaded
.
localhost:~$ more -l +2 upload.txt
.

localhost:~$ head -5 word.txt


line 1
line 2
line 3
line 4
line 5
localhost:~$ head -1 word.txt upload.txt
==> word.txt <==
line 1

==> upload.txt <==


this is a text file with name "upload" to be uploaded

localhost:~$ tail -1 word.txt upload.txt


==> word.txt <==
line 10

==> upload.txt <==


.

localhost:~$ file upload.txt word.txt


upload.txt: ASCII text, with CRLF line terminators
word.txt: ASCII text, with CRLF line terminators

localhost:~$ grep -n "line" word.txt


1:line 1
2:line 2
3:line 3
4:line 4
5:line 5
6:line 6
7:line 7
8:line 8
9:line 9
10:line 10
localhost:~$ grep "name" upload.txt
this is a text file with name "upload" to be uploaded
localhost:~$ wc word.txt
10 20 81 word.txt

localhost:~$ spell upload.txt


/bin/sh: spell: not found
(misspelt words not found)

localhost:~$ cmp upload.txt newfile.txt


cmp: EOF on newfile.txt
localhost:~$ cmp upload.txt word.txt
upload.txt word.txt differ: char 1, line 1
localhost:~$ cmp upload.txt
this is inthe input give
upload.txt - differ: char 9, line 1

localhost:~$ diff upload.txt word.txt


--- upload.txt
+++ word.txt
@@ -1,2 +1,10 @@
-this is a text file with name "upload" to be uploaded
-.
+line 1
+line 2
+line 3
+line 4
+line 5
+line 6
+line 7
+line 8
+line 9
+line 10
localhost:~$ diff upload.txt newfile.txt
--- upload.txt
+++ newfile.txt
@@ -1,2 +0,0 @@
-this is a text file with name "upload" to be uploaded
-.

localhost:~$ gzip word.txt


localhost:~$ ls -lh
total 12K
drwxr-xr-x 2 eeshakam user2 63 Jan 8 15:41 new_folder
-rw-r--r-- 1 eeshakam user2 0 Jan 8 15:51 newfile.txt
-rwxr-xr-- 1 eeshakam user2 58 Jan 8 15:50 upload.txt
-rw------- 1 eeshakam user2 64 Jan 15 15:10 word.txt.gz
localhost:~$ gunzip word.txt
localhost:~$ ls -lh
total 12K
drwxr-xr-x 2 eeshakam user2 63 Jan 8 15:41 new_folder
-rw-r--r-- 1 eeshakam user2 0 Jan 8 15:51 newfile.txt
-rwxr-xr-- 1 eeshakam user2 58 Jan 8 15:50 upload.txt
-rw------- 1 eeshakam user2 81 Jan 15 15:10 word.txt

localhost:~$ tr "line" "LINE"


localhost:~$ tr 'line' 'LINE'>word.txt
localhost:~$ cat word.txt
localhost:~$ cat upload.txt
this is a text file with name "upload" to be uploaded
.
localhost:~$ cat upload.txt
this is a text file with name "upload" to be uploaded
.
localhost:~$ cat word.txt

You might also like