WorksheetsModule II Topics Overview
Total questions: 20
Worksheet time: 10mins
Which command would you use primarily to display the contents of a file?
cat
pwd
mkdir
rmdir
Which command creates a new directory?
mkdir
rmdir
mv
makedir
Which command is appropriate for renaming a file?
mv
cp
rename
rmdir
Which command would confirm your present working directory?
pwd
cd
cp
rm
Which operation best matches the cp command listed under file related commands?
Copying files
Deleting directories
Displaying current directory
Changing PATH
Conditions to remove a directory?
Dierectory should be empty
You should place yourself one level up
both A and B
None of the above
Which statement best distinguishes a UNIX text file from a binary file?
A text file contains only printable characters and lines end with a newline (LF), whereas a binary file may include unprintable characters across the full ASCII range.
A text file contains both printable and unprintable characters, while a binary file is limited to printable characters only.
Text files cannot be displayed, while binary files display cleanly with the cat command.
Binary files are only source code files, while text files include executables and object files.
In a UNIX directory file, each entry includes which two components?
The filename and file contents
The filename and a unique identification number called the inode number
The directory path and permissions only
The inode number and file size only
Which of the following characters cannot appear in a UNIX filename?
Forward slash (/)
Underscore (_)
Hyphen (-)
Period (.)
In a UNIX file system, which symbol represents the root directory at the top of the hierarchical (inverted tree) structure?
\ (backslash)
/ (forward slash)
~ (tilde)
. (dot)
Which command displays the absolute pathname stored in the HOME environment variable?
echo HOME
cat $HOME
echo $HOME
print HOME
Which command displays the full path of your current directory in a Unix-like shell?
cd
pwd
ls
cat
Which command correctly uses an absolute pathname to display the contents of the file login.sql located in /home/kumar when your current directory is /usr?
cat login.sql
cat ./login.sql
cat /home/kumar/login.sql
cat ../home/kumar/login.sql
How long can a UNIX filename be?
255 Characters
8 Characters
8 Digits
None of the above
Frame cd commands to change from:/var/spool/lp/admins to/var/spool/mail
$ cd ../../mail
$ cd /mail
$ cd mail.
All of the above
Find out the easiest way of creating this directory structure: share/man/cat1
$mkdir share/man/cat1
$ mkdir share share/man share/man/cat1
$mkdir cat1/man/share
$ MKDIR share/man/cat1
What will cat foo foo foo display?
Display the contents of file foo 3 times
Display the Contents of file foo
It will not display any output
It stores the output in file foo
How will you copy a directory structure bar1 to bar2?
$ cp bar1 bar2
$ cp –r bar1 bar2
$ cp –I bar1 bar2
$ cp –R bar1 bar2
What are the two types of Device files?
Text files and device file
Block Device and Character Device
Block and Stream file
None of the above
In a relative pathname . represents ------------- and . . represents ----------------------
Current and Parent
Parent and Current
Nothing
Root and Home
