Unix
Unix
Unix
Choos one of the following action when you give sets write permission to sets write permission to
the command $ chmod o-w datafile? everyone for datafile others for datafile
What are the two types of device files? Character & Block Character & Socket
How do you rename a file? mv old new move old new
The cp command will The sort command by
preserve the meta data of default sorts in the numeric
Which of the following statement is true? the file order
Effective user id can be set using following
permission _____ 777 2666
What does rwx r-x r-- means in octal ? 755 743
The name of the top directory is ________ master top
Which is not one of the 3 classifications of users
granted permissions of files? manager group
Which one of the following is the numeric
equivalent for write permission type? 1 2
Where can I find the printer in the file structure? /etc /dev
Which UNIX command is used to update the
modification time of a file? time modify
Which of the following command is used to
display content of a file in octal format? octal cat
Which of the following command is used to count
number of lines in a file? wc -l wc -c
A user does a chmod operation on a file. Which The last accessed time of The last modification time of
of the following is true? the file is updated the file is updated
The permission -rwxr–r– represented in octal
expression will be ____ 777 666
Binary or executable files are _____ Regular files Device files
Which command is used to mount file system
read only? mount –a mount –v
Which of the following commands are used to
display last 10 line of the file? tail filename tail -10 filename
Which command is used to save and exit in vi
editor? q wq
When compare to word processor the vi
editor_____________ easy to use difficult to use
Which command is used to join current line and
next line in vi editor? J j
Which command is used to undo the last
command? undo un
Which command is used with vi editor to save file
and remain in the editing mode? w e
Which command is used to search text
repeatedly in opposite direction? /text ?text
Which command is used to append text after
current line in Vi Editor? A O
Which command is used to take the cursor into
beginning of current line? 0^
Which command sets the number for all lines? :set li :set ln
Which key need to be pressed to end insert mode
and to get edit mode? Control–C Control-D
The run control file in vi is called ______ .cshrc .virc
vi works in _____ 2 modes 3 modes
Which command is functionally equivalent to the
down arrow key? h j
In vi editor, command ‘ZZ’ does which of the Quits the editing session
following? copy the selected text forgetting all changes
Applications of Shell programming include
_______ Simplifying complex jobs Automating reptitive tasks
Which one of the following is not a valid shell
variable? _san san_2
Which is the purpose of id command? Print effective and real UID Print effective and real GID
Choose the format of shell variable declaration? echo $varname echo #varname
What is the meaning of a<<=b if a and b are 2
variables? b = a << b a = a << b
Which of the following will always output "maple"? $tree=maple; echo $tree tree = maple ; echo $tree
Which command is used to remove the definition
of a function(sum) from shell? $unset .f sum $unset sum
Which expression use the value of the enclosed
arithmetic expression? $(()) $()
How could you check if two strings are equal? test $a -eq $b test $a -equal $b
Executing cat /etc/password > /dev/sda as Write data into a regular file Write data to the physical
superuser will _____ called /dev/sda device sda
What command would send the output of cmd1 to
the input of cmd2? cmd1 | cmd2 cmd1 || cmd2
How can you search for blank line in a file? $ grep “ “ file $ grep “^$” file
Which directory contains all the config file of the
system? /etc /var
What are the two separate modes in vi editor? Input and Output Command and Insert
Choice3 Choice4 Choice5
rm cpy
chmod set
/bin /home
ls -a ls -i
4744 1711
754 745
root topdir
3 4
/lib /printer
cat touch
oct od
744 711
Special files Directory files
mount –f mount –r
join jn
u del
a b
n N
a o
$ #
:set nu :set nl
k l
$ #
? /
# @
O o
d2 2d
_san_2 2_san
character float
what purpose
cat filename | tail +5 |
head cat filename | tail -5 | head -10
change -p passwd
who which
declare set
debug db
/home/user1 /home/user1/proj/src/generic
2 3
5 error
mv file[12].txt new.txt ls file1.txt file2.txt | new.txt
break continue
$ *
fi if
do continue
tree=maple;
export tree;
export tree = maple; tree=maple; export $tree; sh sh -c "echo
echo $tree -c "echo $tree" $tree"
${} $[]
0 1
0 1
test $a = $b sh -c test $a == $b
this
this that
other other other
% ;
file size
whoami finger
head 10 filename first -10 filename
none of the
file more above
cd. cd~
wc -c filename wc filename
ls -d [a]* ls -d [aa]*
!3 !$
/lib /bin
chmod –f –r +x chmod –F +x
/home/user1/direct /home/user1/direct
3 4
chmod 310 textfile chmod rw r nil textfile
Terminal Memory
backup of the destination is
Deletes just the softlink automatically created
D d
show display
It is available on most
unix systems Both b and c