Operatingsystemfull Manual
Operatingsystemfull Manual
DATE:
AIM:
1) ls commands
(i) $ls
Eg:
$ ls
(ii) $ls -a
2) mkdir command
Syntax
Eg:
$mkdir GPTC
$ ls
Syntax
Eg:
1. $cd GPT
- Change directory path to GPT directory.
2. $ cd
- To exit all directory and go to root directory.
4) rmdir command
Syntax
Eg:
$rmdir GPTC
$ ls
Ct ex1 ex2
5) pwd
Eg:
$pwd
OUTPUT:
gpt@gpt-OptiPlex-7040:~$ ls
simple test
gpt@gpt-OptiPlex-7040:~$ cd test
gpt@gpt-OptiPlex-7040:~/test$ cd linux
gpt@gpt-OptiPlex-7040:~/test/linux$ cd command
gpt@gpt-OptiPlex-7040:~/test/linux/command$ pwd
/home/gpt/test/linux/command
gpt@gpt-OptiPlex-7040:~/test/linux/command$ cd
gpt@gpt-OptiPlex-7040:~$ ls
simple test
gpt@gpt-OptiPlex-7040:~$ ls
test
gpt@gpt-OptiPlex-7040:~$ ls
Thus, the various commands for directory management were executed and
verified successfully.
EX.NO:2 FILE MANAGEMENT COMMANDS
DATE:
AIM:
To execute the following file management commands and write the results.
1) cat command
This command is used to create a new file.
Syntax:
$cat > file name
Eg:
cat>gpt
HELLO I AM THE STUDENT OF COMPUTER BRANCH.
Ctrl + Z
2) chmod command
This command is used to change the given permission for file.
Syntax:
Eg:
$ chmod 641 gpt
$ chmod +r gpt
$ chmod +w gpt
$ chmod +x gpt
3) cp command
Syntax
$cp filename1 filename2
Eg:
$cp gpt lab
4) mv command
5) rm command
Syntax:
$rm filename
Eg:
$rm gpt
6) more command
This command is used to view the contents of a text file one screen at a time.
Syntax:
$more filename
(or)
$more [option] filename
Options:
Eg:
$more practical
7) concatenate command
8) cmp command
Result:
Thus, the various commands for file management were executed and verified
successfully.
EX.NO:3 GENERAL PURPOSE COMMANDS
DATE:
AIM:
To execute the following general-purpose commands and write the results.
1) wc 2) od 3) lp 4) cal 5) date 6) who 7) tty 8) ln
1) wc
- To count the number of lines, words and characters in a file.
Eg:
$ cat file1
Hai
Good morning
How are you
$ wc file1
3 6 23 file1
2) od
- To dump the files in octal and other formats.
Eg:
$ od file1
0000000 064554 072556 020170 060554 005142 062542 062545 066040
0000020 061141 061412 066040 061141 000012 0000031
3) lp
- To submit the files for printing or alters a pending job.
Eg:
$ lp xyz.c
-This command prints the xyz.c file to the default printer.
4) cal
5) date
Eg:
1) $date –d yesterday
2) $ date –d tomorrow
3) $date
4) $ date + ”%d-%m-%y”
24-8-2016
6) who
- To know the details about the users currently working on the system.
Eg:
$who
7) tty
Eg:
$ tty
8) ln
- This command is used to link a file or directory.
Syntax:
(or)
Eg:
$ ln file1 file2
21:23:17
guest-z9BVJD@gpt-OptiPlex-7040:~$ date +%r
09:23:29 PM IST
guest-z9BVJD@gpt-OptiPlex-7040:~$ date +%Y
2024
guest-z9BVJD@gpt-OptiPlex-7040:~$ date +%y
24
guest-z9BVJD@gpt-OptiPlex-7040:~$ who
guest-z9BVJD :0 2024-06-28 21:15 (:0)
guest-z9BVJD pts/0 2024-06-28 21:16 (:0)
guest-z9BVJD@gpt-OptiPlex-7040:~$ tty
/dev/pts/0
guest-z9BVJD@gpt-OptiPlex-7040:~$ ln linux lab
guest-z9BVJD@gpt-OptiPlex-7040:~$ cat lab
general purpose commands
file managements commands
directory management commands
RESULT:
DATE:
AIM:
1) pr commands
Syntax:
$ pr [-option] filename
Eg:
$ cat lab
linux
os
dld
$ pr –f lab
2) head command
This command is used to displays the first few lines from the top of a file.
Syntax:
$head [-option] filename
Eg:
$ head –2 lab
linux
os
- It is used to display the two lines from top of the file lab.
3) tail command
This command is used to display few lines from the last line of a file.
Syntax:
Eg:
$ tail –2 lab
os
dld
- It is used to display the last two line from the file file1.
4) cut command
Syntax:
-It is used to cut the third character from the file lab.
5) paste command
This command is used to merge the contents of more than one file into a
single file.
Syntax:
Eg:
$cat file1
Good
Bad
$cat file2
Morning
thing
Good morning
Bad thing
6) nl command
Syntax:
$nl filename
Eg:
$ nl file1
1 Hello
2 Gud morning
Syntax:
$sort -b filename
$sort -r filename
8) grep Command
Syntax:
Eg:
$ cat lab
linux
os
dld
linux
- To display the line which has the word ‘li’ from the file lab.
linux
os
dld
- To display the line which has the lowercase letters a-z from the file
lab.
9) egrep Command
Syntax:
Eg:
linux
os
This command is used to Obtain patterns from two (or) more files.
Syntax
Syntax:
$uniq Filename
Eg:
$ uniq -d file1
$ uniq -u file1
1) write
This Command is used used to send message.
Syntax:
$write gpt
EOF
2)wall
Syntax:
$wall username
Eg:
$wall
hai to all
hai to all
Result:
Thus, the various commands for simple filter were verified successfully.