Unit 1 Commands
Unit 1 Commands
LAB EXERCISE : 1
Perform all operations:
a) Mr. Sanjay creates a disrectory called “OS”.
b) Sanjay get into the Directory “OS”.
c) He creates 5 empty files in a single shot.
d) Then he deleted the created Directory “OS” with User permission.
e) Mr.Sanjay created a file with some contents.
OUTPUT:
LAB
EXERCISE : 2
OUTPUT :
LAB EXERCISE : 3
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
b) Remove the directory “DIR5” with the user permission using rm command.
c) Create a file “myfile.txt” with the content and display the numbered non- empty line.
d) Display the $ at the end of each line in the file “myfile.txt”.
e) Display TAB characters as ^I in the file “myfile.txt”.
OUTPUT :
LAB
EXERCISE : 4
Perform all operations:
a) Create the given directory structure in a single shot.
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
OUTPUT :
LAB EXERCISE : 5
Perform all operations:
a) Create the given directory structure in a single shot.
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
OUTPUT :
LAB EXERCISE : 6
Perform the operations with appropriate commands
a. Dispaly todays date in DD/MM/Y format.
b. Display the today date alone.
c. Display the day(eg: Monday)
d. Display the day count of the year(eg: 123 day in 365 days)
e. Display the current time
OUTPUT :
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
LAB EXERCISE : 7
Perform the operations using appropriate commands
a. Display all the files and directories.
b. Display the all files including hidden files.
c. Display the file and directories in detail
d. Display the inode number of dircectories.
e. Display the diectories in sorted order.
OUTPUT :
LAB
EXERCISE : 8
Perform the operations using appropriate commands
a. Display the current month calender
b. Display the current year calender
c. Display 2016 calender.
d.Display your birthday month in year 2016
e. Display the previous, current and next month surrounding today.
OUTPUT :
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
LAB EXERCISE : 9
Verify the mode of operations using appropriate commands
a. Display the current mode of the file f1
b. Change the mode to 0777
c. Allows only owner to do all actions; group and other users are allowed only to read
d. Allows all users can read and write but cannot execute.
OUTPUT :
OUTPUT :
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
LAB
EXERCISE :11
Perform and verify all the following exercises:
a)find the square root of number using bc command
b)find the power of numbers using bc command
c)Increment the value of the variable by 5 using bc command
d)decrement the value of the variable by using bc commands
e)compare two numbers and print the result using bc command
OUTPUT :
LAB
EXERCISE : 12
Perform and verify all the following exercises:
a)convert from decimal to hexadecimal using bc command
b)convert from decimal to binary using bc command
c)convert from binary to decimal using bc command
d)convert from hexadecimal to decimal using bc command
e)convert from octal to decimal using bc command
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
LAB EXERCISE : 13
Perform and verify all the following exercises:
a)find the square root of number using bc command
b)find the power of numbers using bc command
c)Increment the value of the variable by 5 using bc command
d)decrement the value of the variable by using bc commands
e)compare two numbers and print the result using bc command
OUTPUT :
LAB
EXERCISE : 14
Perform and verify all the following exercises:
a)Remove a file named as f1.txt using rm command
b)Remove all files that end with ".txt"
c)Remove a directory when the directory is empty
d)Remove a directory when the directory is not empty
e)Remove every file in the working directory, but prompt before each file to confirm.
OUTPUT :
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
LAB EXERCISE : 15
Perform and verify all the following exercises:
a)Write a unix command to remove a directory?
b)Write a unix command to remove all the files in a directory?
c)Print the lines of file1.txt in reverse, from last line to first.
d) Attach the separator before instead of after using tac command.
OUTPUT:
LAB EXERCISE : 16
Perform the operations using appropriate commands
a. Create a file f1 with the following
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
file name: f1
Contents:
Its
a
great
day!!!
Keep smiling
b. Display the number of lines in a file.
c. Display the number of words in a file
d. Display the number of characters in a file
e. Display the number of byte counts in a file.
OUTPUT :
LAB EXERCISE : 17
a) File named picture.jpg in your working directory, and you want to make a copy of it called
picture1.jpg.
b) Moving file is the file source location must be different with the files destination location.
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
c) If -i options is asking us about overwriting files, than -n option will not allow us to overwrite any
existing files
d) To copy a file from source to destination and when using -i option, it will ask for confirmation
before overwriting a file.
LAB EXERCISE :
18
a) To move multiple files to different multiple location,proceed them in one line separated by space.
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
b) The source and destination files may also reside in different directories. picture.jpg is the source
of the copy operation, and picture2.jpg is the destination. Both files now exist in your working
directory.
d) Write a unix cd command to change the directory using the absolute path?
LAB EXERCISE : 19
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
c) To
copy of
the file
e) Write a unix/linux cd command to change the directory using the relative path?
b) Change current working directory to anything (say /home) and display it in command line
prompt.
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
d) To copy a multiple files present in current working directory into another directory with some
other location in drive to safe backup.
e) Write a unix cd command to change the directory using the relative path?
LAB EXERCISE : 21
b) Store the value of “pwd” command in variable (say a), and print its value from the variable
OPERATING SYSTEMS
UNIT 1 BASIC COMMANDS SESSION 1.1
c) Check the current working directory and previous working directory in one GO!
e)To
copy a
some
source
file
Recursively with option -R from one path to another directory path.
OPERATING SYSTEMS