OS Exercise 1 - 240726 - 151108
OS Exercise 1 - 240726 - 151108
OPERATING SYSTEM
Ex.No:1 INSTALLATION
3
21CSC202J-Operating Systems Lab
4
21CSC202J-Operating Systems Lab
5
21CSC202J-Operating Systems Lab
Click on Install
6
21CSC202J-Operating Systems Lab
7
21CSC202J-Operating Systems Lab
8
21CSC202J-Operating Systems Lab
9
21CSC202J-Operating Systems Lab
Finally you will get the prompt on successful installation of Ubuntu in windows 10 64 bit
Ex. No. 1a BASIC LINUX COMMANDS Date :
a) Basics
1. echo SRM to display the string SRM
2. clear to clear the screen
3. date to display the current date and time
4. cal 2003 to display the calendar for the year 2003
cal 6 2003 to display the calendar for the June-2003
5. passwd to change password
6. mv f1 f2 rename file f1 as f2
3. ls [gpy]et list files whose first letter is any one of the character g, p
or y and followed by the word et
4. ls [a-d,l-m]ring list files whose first letter is any one of the character
from a to d and l to m and followed by the word ring.
e) I/O Redirection
1. Input redirection
wc –l < ex1 To find the number of lines of the file ‘ex1’
2. Output redirection
who > f2 the output of ‘who’ will be redirected to file f2
f) Piping
Syntax : Command1 | command2
head –6 f1 |tail –2 prints the 5th & 6th lines of the file f1.
g) Environment variables
1. echo $HOME display the path of the home directory
3. echo $PS2 display the second prompt string ( > symbol by default )
Method-1
Syntax : chmod [ugo] [+/-] [ rwxa ] filename
Method-2
Syntax : chmod octnum file1
read, & execute permissions for the group members ie; 4+0+1 = 5
FILTERS
1. cut
Used to cut characters or fileds from a file/input
By default, tab is the filed separator(delimiter). If the fileds of the files are separated by
any other character, we need to specify explicitly by –d option
2. grep
Used to search one or more files for a particular pattern.
3. sort
Used to sort the file in order
4. Uniq
Displays unique lines of a sorted file
Syntax : uniq filename
-d option displays only the duplicate lines
-c displays unique lines with no. of occurrences.
5. diff
Used to differentiate two files
Syntax : diff f1 f2
compare two files f1 & f2 and prints all the lines that are differed between f1
& f2.
Q2. Write a command to display user-id of all the users in your system.
$
Q3. Write a command to check whether the user judith is available in your system or not.
(use grep)
$
Q4. Write a command to display the lines of the file f1 starts with SRM.
$
Q6. Write a command to display the unique lines of the sorted file f21. Also display the
number of occurrences of each line.
$
Q7. Write a command to display the lines that are common to the files f1 and f2.
$