UNIX POINTS TO REMEMBER 1) Unix is a multiuser multitasking operating system. 2) Everything in Unix is treated as files.

Including devices like printers,RAM etc 3) Unix can have multiple shells but only one kernel. 4) Shell is a command interpreter.It basically interpretes the command for the kernel and calls the kernel using system call functions. The kernel then performs the required action and returns the control to the shell. For eg : When we type a command using a metacharacter,the shell interprets that metacharacter and then passes it on to the kernel. In the case of rm *, the shell replaces * by all the files in the current directory and then passes it on to the kernel. 5) The Unix file system is like an inverted tree structure. 6) Root directory represents the uppermost directory in the file system under which all the files exists.Root is represented by FORWARD SLASH / 7) There are two types of paths one can use to navigate to different directories.Absolute and relative path. Absolute Path and relative Path Say U are in the path home/testing/hello/world/dir/files and U want to navigate to hello directory.We can do that using absolute and relative paths: Absolute: cd /home/testing/hello Relative : cd ../../.. (Note .. represents parent directory) 8) pwd command prints the present working directory. 9) cd is the command to change the directory. 10) cat is the command to concatenate files. 11) Just by simply typing cd would take us to the home directory defined by the $HOME variable. 12) The ls command is used to list files. 13) ls -l command would list files along with their permissions user name and group name and also the size.

14) ls -a command would be used to list hidden files. 15) ls -r command will list files in revese order. 16) ls -i will list files against their inode number. 17) Files and metacharacters: ls * --- Will list all files in current directory. ls a? -- Will list files starting with a and second letter of the filename being any ASCII character. ls a* -- Will list all files beginning with a ls *.* --- WILL list all files with a single dot in between filenames. ls [!abc]art-- Will list files not beginning with a or b or c and next three characters being art. ls [b-dku-z]*-- Will list files beginning with either b-d which is b,c,d or with k or with u-z i.e u,w,x,y,z. 18) mkdir is the command to make directory. 19) rmdir is the command to remove directory. 20) chmod command is used to change the permissions of a file. 21) We can change the permissions of a file using the chmod command using the symbolic and absolute modes Symbolic mode: chmod a+rwx xyz.doc (Note : a --- all, u --- user , g --- group, o --others) Absolute mode: chmod 777 xyz.doc (Note : read --- 4 , write --- 2 , execute --- 1)

22) mv command can be used either to rename a file or change the location of a file. 23) There are two types of links : Hard and Soft Link. Hard Link : ln file1 file2 (Here file2 becomes a link for file1.On deletion of file1,file2 can be accessed.) Soft Link : ln -s file1 file2 (Here file2 becomes the soft link of file1 (basically a pointer to file1) hence on deletion of file1,file2 becomes a dangling pointer and the file1 contents are not accessible.)

24) find command is used to find files in the Unix system. 25) grep(global search for regular expression and print) command is used for searching a particular pattern in a file. grep [options] pattern filename Example : grep "Testing" Testing.dat --- Will search for the word Testing in the file Testing.dat 26) tr command can be used to translate characters in a file. 27) vi Editor is used as a text editor for files in unix.There are three modes in vi editor 1 --- Command Mode ---- in this mode we can use commands to modify the text of the file.For eg: cw command entered during command mode is used to change a particular word. 2 --- Input mode ---- in this mode we can insert text into the file. 3 --- Last line mde ---- in this mode we can search for a particular pattern in the file. 28) :set nu is the command to number the lines :set showmode shows the mode :se ic used to ignore case 29) We use the fg command to bring a background process to the foreground. 30) nice command is used to reduce the priority of a process.We cannot increase the priority of a command but only reduce it using the nice command. 31) bc is the basic calculator utility in unix. If without setting the scale, 5/2 would result in 2. After setting the scale=2, 5/2 would result in 2.50. 32) Always assign the value of the variable without a space in between. Like name=256 and not name =256 or name= 256 or name = 256. 33) To see all the environmental variables set we can use the set command. 34) If a=5 and b=10 $a + $b would not add the two variables as they are treated as string of characters.In order to add them we use the expression in the backquote `expr $a + $b`. 35) In case of floating point arithmetic we use the bc utility as shown below:

what are the default application programs installed with unix? Like gcc.e to make it available for all its child shells.types of shell available? 5.5. 37) Parameters can also be used to pass arguments to a script.which option along with rm <file_name> will recursively remove the files? 11. 1.what is known as referring a file from root directory?(Absolute path name) 8.sh file1 file2 file3 Here $1 --.which option creates directories along path name? 13.file3 Positional parameters from $1 through $9 are available.Options used with ls commands(be through with options of every command)? 10.file naming conventions? 7. Answer: Hierarchical or Inverted tree file system 2.5 c=`echo $a + $b | bc` 36) export is the command to make the variable global i.file2 $3 --.which command tells about present working directory? 9.c… 3.which of the following enforces security scheme? a)kernel b)shell 4.sh is a script which requires 3 filenames as arguments then 1.t.which of the shell allows command history to be tracked?? 6.command used to list the contents of file? 12.For additional parameters the shift command can be used.e.creating hard and soft link between files using ln? .The File System used by unix is ………….a=13.file1 $2 --.what are levels in file security? 14.symbolic and absolute mode of changing file permissions? 15. If 1. b=1.g++.

usage of –gt.cat <file_name what will be output? 18.dat output?? 19.cat>>file_name .-lt.can the mv command be used to rename a file? 1.cursor movements ? 21..man command usage? 17.lw 1>The output of ls command is stored in SampleFile 2>The output of wc command is stored in SampleFile 3>The output of ls is treated as input to wc and the count is stored in SampleFile 4>The output of ls is treated as input to wc and the count is displayed and stored in SampleFile ANSWER>3 2.continue and break statement? 27.16.gives error 3>Copies File1 contents to File3 4>Copies File1 to File3 and creates an empty file File2 5>None of them ANSWER>4 3. What is the command to Print the searched pattern with the line numbers in File1 1>$grep -N “Accenture” File1 2>$grep -nv “Accenture” File1 3>$grep -n File1 4>$grep -n “Accenture” File1 5>All are correct . 23.screen movements? 22.parameters to shell script??(ex:what is used to get pid of the shell)? 29.else? 25. What is the output of the following Command $ls -R | wc .use of wildcards in filename? 20.? 28.command used for getting process id? 24. What is the output of the following command $ cat File1>File2>File3 1>Copies the contents from File1 to File2 and File3 2>It is a wrong command .which commands is used for exit terminal without saving? a)q! b)q c)none.etc….-le.usage of $#.usage of echo statement? 26.usage of test and [] with if .$0? 30.cat<file_name | grep “string” emp...

Unix file system has which of the following file structure 1>Tree Structure 2>Standard Structure 3>Hierarchical Structure 4>None of the above ANSWER>3 9.6>None ANSWER>4 4. In the vi editor to delete a char 1>h 2>j 3>x 4>k 5>l ANSWER>3 6. To save a file without quitting the vi editor is done using the command 1>:q 2>:w 3>:w! 4>:wq 5>:q! ANSWER>2 7. What is the output the following command % sort -t “|” +3 -5 Students 1>The records will be sorted based on 4th to 5th columns 2>The records will be sorted based on 3rd and 5th columns 3>The records will be sorted based on 3rd to 5th columns 4>The records will be sorted based on 3rd to 4th columns ANSWER>1 8. What is the output of the following command $rmdir dir1 dir1/dir2/dir3 1>deletes dir1 and dir3 directories 2>deletes dir1 directory 3>deletes dir1 dir2 and dir3 directories 4>error ANSWER>4 5. In unix grep-n command displays the 1>Line matching the pattern along with its line number 2>Only a count of the line that match a pattern 3>Prints out all those lines that do not match the pattern .

5>cd ANSWER>5 . 4>Write a C++ program. To sort this data which command/method you will prefer most.txt 2>bin/cat 3>abcd/ 4>/usr/bin/cat ANSWER>4 11./home/abc.e file with list of numbers in it).. Kernel Manage 1>Entire resources of the system 2>Schedules the work done by the CPU 3>Enforces the security scheme 4>a & b 5>b & c 6>a b & c ANSWER>6 12. You can always return to your home directory by using the command 1>cd / 2>cd \ 3>cd HOME 4>cd . 1>sort <file_name> 2>sort –n <file_name> 3>Write a C/C++ program. Use STL sort algorithm ANSWER>2 14. You have a file with numerical data in it (i. Which of the following represents an absolute path? 1>.. Assume that list is reasonably small and Quick output is high priority.4>None of the above ANSWER>1 10. Which option of grep displays the count of lines matching the pattern 1>-c 2>-nc 3>-v 4>-lc 5>-ln ANSWER>1 13. Use quick sort.

/trng/./trng/. 2>It will display an error in the command 3>10 4>None of the above ANSWER>3 18. 1>cat 2>ls 3>wc 4>grep filename ANSWER>3 19. 2>cp file1 /trng/.. You are currently placed in “data” directory placed under the directory “training”. who | wc –l What is the output of the following command if 10 users are connected? 1>It will display the list of all the users connected. ANSWER>1 17. 4>mv ./data/. Which option of sort allows you to sort data in descending order 1>-r 2>-o 3>-f 4>None of the above ANSWER>1 20.. You are currently placed in “trng” directory placed under the directory “training”./file1 . 4>cp file1 /trng/.... 3>cp . 5>cp file1 trng/. 3>mv file1 .15. words and characters./data/. The command to move the file “file1” from “trng” directory to “data” directory placed under the directory “training” is: 1>mv file1 data 2>mv file1 data/. Which unix command gives the number of lines . Which option of ls will allow you to display the files in reverse order 1>r 2>-r 3>R . ANSWER>3 16./file1 .. 5>mv file1 /data/. The command to copy the file “file1” from “data” directory to “trng” directory placed under the directory “training” is: 1>cp file1 .

What command do you use to copy files from all sub directories to another directory 1>$cp -r Dir1 Dir2 2>$cp -i Dir1 Dir2 3>$cp -a Dir1 Dir2 4>$cp -m Dir1 Dir2 ANSWER>1 22. Which character must be specified at the end of the command in order to execute that command in the background ? 1>& . Which of the following commands will display the names of hidden files ? 1>ls –h 2>ls –a 3>ls –l 4>ls –x 5>ls –p ANSWER>2 25.4>-R</ 5>None of the above ANSWER>2 21. Which of the following commands will display the details of directories only of the current directory ? 1>ls –d 2>ls -l | grep “d$” 3>ls -l | grep “^d” 4>ls -l | grep “d^” 5>ls -l | grep “$d” ANSWER>3 26.:” Student1 Student2 1>-d stands for define 2>-d stands for difference 3>-d stands for delimeter 4>None ANSWER>3 24. In the following command $paste -d “. The command used to slice the files horizontally is 1>cut 2>paste 3>head 4>cat ANSWER>3 23.

ln -s <filename><linkfile> will create ----. If there are 5 files in the current directory and if ls -l | wc -l command is given in the current directory.link to the file 1>soft link 2>symbolic link 3>hard link 4>both 1 and 2 ANSWER>4 30. Which option of “mkdir” command allows you to create sub-directories in one single statement . then the output of this command will be 1>5 2>all the filenames will be displayed 3>6 4>all the lines of all the 5 files. Which of the following escape sequences can be used to keep the cursor on the same line after displaying the output with echo command ? 1>\a 2>\b 3>\c 4>\k 5>None of the above ANSWER>3 29.2>^ 3>% 4>$ 5># ANSWER>1 27. 5>syntax error will be displayed ANSWER>3 28. State TRUE/FALSE Using 'mv' command can we rename a file 1>TRUE 2>FALSE ANSWER>1 32. __________ is the command to append into the contents of a file 1>cat > filename 2>cat >> filename 3>cat < filename 4>cat >>> filename ANSWER>2 31.

and nothing for everyone else? 1>chmod 046 textfile 2>chmod 640 textfile 3>chmod 310 textfile 4>chmod rw r nil textfile ANSWER>2 35. Which are the different ways knowing more about the command 1>man 2>help 3>information 4>All of the above ANSWER>1 38. the current directory is set to home directory. 1>TRUE . Which of these expressions shows the proper way to add the directory /usr/bin to your path? 1>PATH+=/usr/bin 2>PATH=/usr/bin 3>$PATH:/usr/bin 4>PATH=$PATH:/usr/bin ANSWER>4 34./home/abc. Which of these commands will set the permissions on file textfile to read and write for the owner. Which of the following represents an absolute path? 1>.. Which of the following pieces of information is not contained in the passwd file? 1>A user’s unencrypted password 2>A user’s login name 3>A user’s preferred shell program 4>A user’s group ID ANSWER>1 37.txt 2>bin/cat 3>abcd/ 4>/usr/bin/cat ANSWER>4 36.1>w 2>-w 3>p 4>-p 5>None of the above ANSWER>4z 33. read for the group. State TRUE/FALSE: When you log in.

When do we use the command. ANSWER>2 40. 3>None of the above ANSWER>1 . What would happen when a user executes the following command and enters the details as shown below? a) $ cat < test1 <enter> 1>The cat command will take each line of the file test1 as input and display it on VDU. ps –e 1>List full process showing the PPID 2>Display All processes including user and system processes 3>Dipslay Processes of User 4>Displaying all Users processes. 2>The cat command will take each line of the file test1 as Output and display it on VDU.2>FALSE ANSWER>1 39.

wht is the o\p of ? Ls-L >data Ls>data Both will display the same output 19.x 6 Wht is used to quit frm VI editor without saving . 13. unix structure is said to be? TREE.S 1 $cat <file1>file2 -ans file1 is created and contents of file1 is copied to file2 2 $cat <test After execution the standard input is reassigned to the default device.j 5 Wht is used to delete one line down in VI editor .wht is PID of init?1(PID process id ) 17. wht is the PID of current shell? $$ 22.\n newlinw is used 15.cat file1>file2>file3 Content are copied to both file2 & file3 21.HEIRARCHIAL.IF ANY CHANGES IN PERMISSION ARE TO BE DONE FOR A USER who is a owner then the option used is -o for owner(ans) -u for user .RELATIONAL 23.wht cmd is used to move to the next line ? 14.:q! 7 Wht is used to save frm VI editor without quiting .pipe ( | ) 4 Wht is used to move one line down in VI editor . wht is absolute path? Referring file frm its root directory 11.wht is the job of nop hup?the process can continue execution even after the hang up 16.:w 8 Both saving & quiting :wq 9 $echo$?? ---will display 0 if the cmd was successful Else 1 10. banner great >great ---great will be enlarged & stored in file name great 20.$ sleep 10 ---it will wait for 10sec 18.Unix & O. 3 Wht connects 2 or more cmds. 12. wht is relative path? Referring frm current directory Eg home/ulka.no newline \c is used.

-g group 24. option used with mkdir? Answer is ( -p) 1.4 How do you visualize the content of file "not_empty"? type not_empty .3 How do you rename file "new" in file "old"? mv new old cp new old rn new old ans:a 1.2 How do you list all the files that are in the current directory? list all ls -full ls -a ans:c 1.1 How do you get help about the command "cp"? help cp man cp cp ? ans:b 1.

txt -length=15 c>head -15 *..Level 2 2./.2 How do you print the first 15 lines of all files ending by "..5 How do you create a new directory called "flower"? newdir flower mkdir flower crdir flower ans:b UNIX Quiz .txt"? a>print 15 .cat not_empty more not_empty ans:b 1.txt ans:c 2.txt b>cat *.3 Make a copy of file "upper" in the directory two levels up. c>cp upper -2/ ans:b .1 What is the command to search all files in your current directory for the word "plasmodium"? a>grep plasmodium * b>find plasmodium -all c>lookup plasmodium * ans:a 2. a>jump -2 upper b>cp upper .

txt -d copy.1999 c>grep 1999 *.4 How do you uncompress and untar an archive called "lot_of_thing.txt >> result.42.197.5 Change the current directory to /usr/local/bin a>mv /usr/local/bin b>cd /usr/local/bin c>setdir /usr/localbin ans:b 3.txt | grep 1999 >> result. and add the result to file result.3 How do you tell the server to use your local display (197.2.Z" .txt and copy.tar.42.42.197.4 Count the files you own in all your directories.67) for X-windows? a>set display local b>setenv DISPLAY 192.1999 a>diff orig.txt | grep 1999 > result.1999 ans:b 3.1999 b>diffb orig.67 ans:b 3.2 What is the command to find the differences in the lines containing "1999" between the files orig.1 How do you change the access permission (add group read/write) to all the files in the current directory containing the word "cali" in their names? a>chmod g+rw *cali* b>setperm r+w *cali* c>chmod 0060 *cali* ans:a Unix 3 3. a>ls -lR | grep myusername | wc -l b>ls -a | cnt * c>ls -n ~myusername ans:a 2.txt copy.67:0.197.0 c>setdsp x 192.txt.

Z ans:b 3. $ls -d b.txt | head file2. To list all the files and directories ls is the option.Z | tar xvf c>tar xvf lot_of_thing..tar.Z | decomp b>zcat lot_of_thing.5 Create a new file "new. d$ls | grep "[d$]” e. a.txt ans:a UNIX QUESTION 1). a>cat file1.a>tar lot_of_thing.variable variablename datatype := d. (A) seems to be correct . variablename variable datatype := Ans: 2).txt+file2.To list all the files and directories of current directory. $ls | grep "[d^]” d.Which one of the following is the Correct syntax to declare a variable in PL/SQL a.txt" and "file2.txt > new.. variablename datatype := b.txt" that is a concatenation of "file1.declare variable variablename datatype := c.tar.txt=file1.tar. $ls | grep "[$d]” Ans.txt c>tail file1.txt > new.txt".txt file2.txt b>make new. $ls | grep $"[^d]" c.

Error e. d) Displays $? Ans: Exit status of the previous command 8).3).$val1=10. Ans: 5) What is output of value of x(something like this) a. false Ans: B) False 7).8 d. val2=25. What will be the output of the following command $echo $? a) Exit status of the previous command.None b.No value of x Ans: Error 6).25 c. b) Process id of the previous command.9 Ans.35 d. True b. 4) What will be the output of the following command . We can remove only one file at a time a. c) Previous command status.What is the value of j after execution of this statement? a.10 b. What will be the output of the following command $echo * a) It will display * b) It will display all the files of the current directory c) It will not display anything ie blank .7 c. $ x:=${val1-val2:=35} $ echo $x.

dir2 and dir3 c. Ans: 12).n-1.Minimum no. remove dir1 only b.%B d. b. remove dir1. Ans: B) It will display all the files of the current directory 9). remove only dir3 Ans: Remove dir1 only 10).%b Ans: C ---.%m b.%M c.Which option will print the files in reverse order? a) r b)R c)-r d)-R Ans: Ans c) -r .d) Error. Which command will give the “WRITE PERMISSION ” to the user a)1 b)2 c)3 d)4 e)5 f)6 g)7 Ans: 13).n-2. of joins to avoid cartesian products of tables a. c.Which is the correct format to print full month using the date command? a.%B 11).n-3. What will be the output of the following command $rmdir dir1 dir1/dir2/dir3 a.

c) number student_id Ans:.none.characters from a file 'data'? a) wc –l data b) wc –w data c) wc –c data d) wc data Ans. 15). D) 19) Exit statement used to terminate from which options – a) switch construct b) if construct c) loop construct d) while construct Ans : c) loop construct .0 (c).1 (d).as student_id of student a) v_id student_id%TYPE b) student_id number.How will be the declaration of a variable of identical data type . Ans) a) displays the contents 18) Command to get total no of words.What does this command will do $cat test.doc Ans: (a).14).lines.Conditional predicates in a trigger body a) Updating b) Insert c) Delete d) select Ans: 16).displays the contents of file test (b). 17). Raised exceptions are handled in seperate routines called a) exception handlers b) exception statement c) exception blocks d) excution section Ans.

d)displays all files and dir’s starting with sample and after sample. Ans: a) Displays the system date and then prompts for the user input.displays non hidden files ending with sample. c). a)The sum is : 50 b) 50 c) Error .sort a) Displays the system date and then prompts for the user input. Not sure but make a check 24) What will be the output of the following command echo "The sum is x='expr 20+30' . c) Displays the contents of the file ‘data’ d)none Ans: c) Displays the contents of the file ‘data’ 22) What will be the output of the following command $ ls sample* a)Displays hidden and non hidden files starting with sample. b). d) Displays 5 chars from 3rd position Ans: It should display 3rd to 5th characters of every line. None of the options seems ok to me 21)What will be the output of the following command Cat < data a) Takes output from the file and displays them on stndrd output. Ans: d)displays all files and dir’s starting with sample and after sample. c) Displays 2 chars from 3rd position. 23) What will be the output of the following command $ date. b) Takes the values from the stndrd input. c) Displays the system date and then prompts filename.20) What will the following command will do ? $cut -c 3-5 data1 a) Displays 3 char from 5th position b) Displays 2 char from 1st position. b) Takes the system date and waits for the file to be sorted.. d) Error.displays non hidden files starting with sample. echo $x.

vref). If single quotes are used in expr then error else a) option is the answer 25) Find the error(if possible) in the following snippet of code Begin v_ref+10=v_fnum +v_lnum. a) . c) Incorrect declaration.\a\b\c (Not confirmed about the options. please provide the correct answer) It will create directory a with sub-directory b which will further have sub-directory c. b) v_ref and v_fun should be declared. { Choose more than 1 answer} a) = operator can’t be used on the left hand side for the variable declarations.Ans: Just check whether back quotes are used or single quotes are used. Ans: Not sure  28) What the following command will do $ mkdir –p . Ans: 26) A variable that stores column value needs to have the same name as column (T/F)? Ans: 27) What will the following command do Cat>file1> dest1 >dest2 2> dest 3 a) file1 contents are in dest3 and dest1 and dest 2 is empty b) file1 contents are in dest1 and dest2 and dest3 are empty.. end. dbms_output. d) file1 contents are in dest1 and dest2 and dest3 are empty. d) Error.\a\b b) \usr\bin\cat c) \bin\cat\ d) ..\home\usr\dir .put_line('sum is'. 29) Which one gives the absolute path.

a) b) c) d) –d –n –r –a 2.test3 with . a) cat>file b) cat>>file c) cat<<file e) cat<>file 4. Set of environment variables . a)* b)[] c) ? d) / e) \ Ans: aits actually zero or more characters 31)What will be the output of the following command. a) b) c) d) man help info all of the above 3. b) Removes test1 or test2 or test and ending with .test3 with .txt. 1. d) Removes test1 and test3. Ans: Remove test1. ---------------------command to get information of a command. To append a file.test2.Ans: b 30) Which wild card character will be used to display more than one character. ---------------.txt a) Remove test1.test2.txt extension.option is to list in reverse order.txt extension. what is the right way. $ rm test[1-3]. c) Error cannot include range in [].

-----------------redirects command out a) b) c) d) &amp: >filename :>filename a:>filename none of the above 6.Ending of case block is ---------------a) esac b) case end c) end d) none of the above 11.$PS1 $home none of the above 5. 8. -----------------. To display the last 20 lines of a file a) b) c) d) tail -20 <filename > tail +20 <filename> home -20 <filename> none of the above. If the value=’ls|grep’.PS1 $Home.is a metacharacter a) b) c) d) ? \ * $ 10.$Path.echo $value a) b) c) d) ls|grep “ls|grep” error none of the above 7.a) b) c) d) Hone.Searching for files with specific string using -------------a) find b) grep . Shell is a ----------------------a) b) c) d) programming language layer between kernel and user command interpreter all of the above 9.Path.

Which is a type of shell ? .c) find & grep d) find grep 12. To list the details of a file. Files are searched based on name and extension using -----------a) find b) search c) grep d) locate 14. Shell scripts begin with a) # b) % c) & d) $ 15. 17. #!/bin/bash while[! –z$1] do echo $1. ls-l only will give the details of file. shift done a) b) c) d) shift is not used peoperly error message no such command syntax error run-time error 16. using ---------------a) ls b) cd . c) cd d) none of the above Note: ls just gives the list of file. . a) b) c) d) Shell scripts cannot be used for system administration open communication implementing data structure non-portable application 13.

Positional parameters where the values are positioned using e) $1.2. How to end the statement at the end of every case? a) .$3 etc c) 1 22.a) Korn b) corn c) hash d) bad 18. b) to connect one process to another c) d) none of the above 19. c): d):: 24. b).To locate the beginning of file with a and ending with a .export is used for a) making child shells to see their parent shells b) making sub-programs to see the shell variables c) none of the above d)for displaying errors 25. ?? [0-9] b) cat a?? *[0-9] c) cat a*[0-9] d) none of the above 21.Redirection is used for a) inter-process communication.file1 a) 5th field onwards to cut b) 5th field from the beginning to cut c) 6th field from the end to paste d) none of the above 23.. followed by a number ------------------a)cat a*.$2 etc b) $1. #!/bin/sh and #!<whitespace>/bin/sh ----------what is the difference between these two statements? c) nothing b) syntax error . Cut –d “ “ –f 5.

Ans: is this syntax correct Find/path-type d. use STL sort algorithm b) write a c/c++ program use quick sort c) sort d) sort –n 5) shell scripts cannot be used for which of the following: I sytem administrator II open source applications III implementing data structure IV non portable applications Options: 1) I & II 2) II & III 3) only III . text file and the root. echo a d) a will be displayed b) runtime error c) 20 is diaplayed d) syntax error 27. you are interested in one particular process job but unfortunetly it is runnig in the background.exec command / * { }. a=20. using appropriate commands you have found out list of available jobs process ids. e) I will use cmd %fg. In bash shell. 1) How are shell variables assigned in C shell & Bourne shell(Syntax) 2) How will you find a file and delete directory and execute. each current directory. Assume that list is reasonably small and quick o/p is high priority. each mounted on file. 3) what is true of Inode? a) there is a unique inode allocated for each active file . b) An node is “named” by its device/ I-number pair c) An inode is the pid of the current process Options: 1) a & b 2) a & c 3)b & c 4) You have a file with numerical data in it(i.c) run-time error d) all of the above 26. How will you make it run in the foreground.e file with list of number in it) to sort this data which command/ method you will prefer most. a) write a c++ program.

11)filesa are searched based on name and extension using a) find b)search c)grep d) locate 12) shell scripts begin with a) # b) % c)& d)$ 13) # /bin/bash .4) only IV 6) shell is a a) programming language b) layer between kernel and user c) command interpreter d) all 7) _________ is a meta character a) ? b)\ c)* d)$ 8) searching for files with specific string using a) find b)grep c)find & grep d) find grep 9) shell scripts cannot be used for a) system administration b) open communication c) implementing data structure d) non-portable application options: i) a and b ii) b and c iii) only c iv) only d 10)what is the o/p? #!/bin/bash while[!-z $1] do echo $1 shift done a) infinite loop with first and the parameter echoed during each loop cycle b) list of all command line parameter passed c) error message/ message indicating no such command for shift d) infinite loop with first command line parameter echoed during each loop cycle.

a) I & II b) II & III c) III & IV d) None 19)To locate the beginning of a file with ‘a’ and followed by any character then ‘ . shift done a) shift is not used property b) error message no such command c) syntax error d) run-time error 14) to list the details of a file using a) ls b) ls-l c) cat d)none 15) redirection is used for a) interprocess communication b) to connect one process to another c) none of the above 16) After child process generated immediately what is the PID of it a) 0 b)>1 c) -1 d)none 17) diff between #!/bin/sh and #! <White space>/bin/sh a) nothing b) interpreter gives one error on some flavour of unix c) because #! Is a 4 byte magic number d) b and c 18)I communication between related process II communication between unrelated process III to avoid files in IPC IV none of the above Ans:.while[!-z $1] do echo $1. ‘ then 2 characters followed by a number a) cat a*.??[0-9] b) cat a??*[0-9] c) cat a*[0-9] d) none 20) cut –d “ “ –f5 – file1 a) 5th field onwards to cut b) 5th field from beginning to cut c) 6th field from the end to paste d) none 21) all lines begin with a number a) ^[0-9] b) [^0-9] c) ^[#] .

txt tr-d ‘\r\n’ <xyz. * $ 22) !#1 bin/bash error is shown on stderr however script 23) export is used for a) making child shells to see their parent shells b) making sub programs to see the shell variables c) none of the above d) for displaying errors 24) syntax a) b) c) d) for tr command to delete a new line from a file tr-d ‘\n’ <xyz. ‘c\r\n’ <xyz.WHO .txt Note: It must be either a or b.txt tr ‘\n’ <xyz.txt tr.d) ‘[0-9]. because tr command accepts 2 parameters only. 25)For the command on a execute folder named test /bin/chmod a-x test a)user will not be able to create any sub-directory b) user will not be able to list the content of this folder c) user will not be able to browse through the folder and subfolder d) all the above 26) when unix is installed which of the following is automatically installed a) c++ b)c c)perl d) visual Basic Note: I guess it is C 1>The command which tells how many users are presently logged in? A.

what is the output of the following command?? If test1 hello Test2 hi Test3 how r u A.test2.noclobber 11>DATE : 07/06/06$JULY is got by executing A.test3.2>Which option creates multiple links in Unix file system? A.ln 5>The command rm test[1-3].txt.txt.deletes test1.Date +date %d$b 12> cat test1 test2 test3>test4.hello hi how r u 19>Which is the command which helps to find the location of another command in unix?? A.txt A.which .txt 6>which method is used to prevent overriding of files? A.

Sign up to vote on this title
UsefulNot useful