DOS Assignment 01
DOS Assignment 01
On
Design of Operating System (CSE 4049)
Submitted by
Submitted by
Question1:
Write the commands to create the following directory hirarchy:
-> DOS_Regdno ->DOSass1->dir1
Command:
mkdir DOS__2141003017
cd DOS__2141003017
mkdir DOSass1
cd DOSass1
mkdir dir1
Output:
Question2:
Write the commands to create another directory with name dir2 in directory DOSass1 and make
dir2 as the current working directory.
Command:
mkdir dir2
cd dir2
pwd
Output:
Question3:
Write the command to delete the directory dir2 , when DOS_Regdno will be the current working
directory.
Command:
Cd ..
cd ..
rmdir DOSass1/dir2
cd DOSass1
ls
Output:
Question4:
Write the command to create a file named as file1 using cat command inside dir1. Write your
name, regdno, branch, semester and section in file1. Then display the content of the file.
Command:
Cd dir1
cat > file1
Name: Utasv choudhary
Regdno: 2141003017
Branch: CSE
Semester: 5th
Section: E
Cat file1
Output:
Question5:
Write the command to create a file named as file2 using cat command inside dir1. Write your
semester wise SGPA in file2.
Command:
cat >file2
Sgpa:-
11
11
11
11
Output:
Question6:
Create a file named as file3 storing content of file1 merged with content of file2.
Command:
cat > file2
Sgpa:-
11
11
11
11
Output:
Question7:
Write the command to rename file2 as markinfo.
Command:
mv file2 markinfo
ls
Output:
Question8:
Write the command to copy the content of file1 to reginfo.
Command:
cp file1 reginfo
ls
Output:
Question9:
Write the command to display the inode values of file1,markinfo, reginfo
Command:
ls -I file1
ls
Output:
Question10:
Write the command to delete file1.
Command:
rm file1
ls
Output:
Question11:
Write the command to count the number of lines, words, characters in markinfo.
Command:
wc markinfo
Output:
Question12:
Write the command to create a file named as Personalinfo inside dir1. Write your name, regdno,
address in the file.
Command:
cat > personalinfo
Name: utsav choudhary
Redgno:2141003017
Address:Student
cse Branch
Ranchi,834001
Output:
Question13:
Write the command to display the content of markinfo in reverse order
Command:
sort -r markinfo
Output:
Question14:
Check the output of the following command:
cmp reginfo personalinfo
diff reginfo personalinfo
Command:
cmp reginfo personalinfo
diff reginfo personalinfo
Output:
Question15:
Write a command to count the number of files in the current working directory and display that
number
Command:
ls | wc -l
Output:
Question16:
Write a command to include all the file names present in a current working directory in a file
named as filelist without causing filelist to be included in the names
Command:
ls > filelist
cat filelist
Output:
Question17:
Write a command to give write permission to all the users of file reginfo.
Command:
chmod a+w reginfo
ls -l reginfo
Output:
Question18:
Write a command to discard write permission from group users group users of file reginfo.
Command:
chmod g-w reginfo
ls -l reginfo
Output:
Question19:
Write the command to set rwx permissions for all the users of file reginfo.
Command:
chmod a+rwx reginfo
ls -l reginfo
Output:
Question20:
Differentiate between following commands:
date; pwd
date; pwd | wc -l
(date; pwd) | wc -l
Command:
date; pwd
date; pwd | wc -l
(date; pwd) | wc -l
Output:
Question21:
Interpret the output of the following commmands:
echo *
echo ***
echo '***'
echo \***
echo \*\*\*
echo */*
echo Don't do this
echo “Don't do this” (Quotes of one kind protect quotes of other kind)
echo Hello # world
echo “ Hello # world”
echo ' Hello # world'
echo date
echo 'date'
echo “date”
echo `date`
Command:
echo *
echo ***
echo '***'
echo \***
echo \*\*\*
echo */*
echo Don't do this
echo “Don't do this” (Quotes of one kind protect quotes of other kind)
echo Hello # world
echo “ Hello # world”
echo ' Hello # world'
echo date
echo 'date'
echo “date”
echo `date`
Output: