Você está na página 1de 6

Unix Paper 1.

which are the three commands that you would try to log yourself out of the system A. B. C. D. Ctrl+u,logout,exit Logout,Ctrl+d,exit Ctrl+d,logout,Ctrl+c All of the above

2. Which of the following sequence will produce the list of only directories as the output A. B. C. D. ls directory ls l | grep $d ls l | grep ^d Both B and C

3. Which of the following command tells you the machine name? E. F. G. H. uname r uname s uname hostname uname n

4. I want to replace all the occurrences of string1 in my text file with string2. Which of the following command will work for this in the vi editor A. B. C. D. :1,$s/string1/string2/n :1,$s/string1/string2/g :1,$s/string1/string2 All of the above

5. Which of the following directories does not come under /(root)? A. B. C. D. bin home usr None of the above

6. Which one of the following will suspend the running process? A. B. C. D. ctrl+z ctrl+c ctrl+k ctrl+d

7. Which one of the following will kill the running process? A. B. C. D. ctrl+z ctrl+c ctrl+k ctrl+d

8. What is that entity known as that interacts with the user and the kernel? A. B. C. D. Command Interpreter Shell Kernel Both A and B

9. What is the entity known as that controls the whole hardware? A. B. C. D. Shell Command Interpreter Kernel Both A and B

10. What device represents the Stdin A. B. C. D. Monitor Mouse Keyboard None of the above

11. The standard values used for the permission bits are A. B. C. D. r=1,w=2,x=3 r=1,w=2,x=4 r=4,x=2,w=1 x=1,w=2,r=4

12. To take the input for the cat command from file1 and send the output to file2 , which of the following holds good A. B. C. D. cat >file2<file1 cat <file1>file2 cat <file1>>file2 All of the above

13. The shell built-in commands are known as A. B. C. D. External commands Internal Commands Exterior commands Both A and C

14. How do I create a file second.txt containing the first 7 lines of the file first.txt? A. B. C. D. head n 7 first.txt | second.txt head n 7 first.txt > second.txt head -7 first.txt > second.txt Both B and C

15. You are inside the vi editor and without closing the editor you want to come to the shell for executing some commands. Which of the following will do the job? A. B. C. D. :shell :$shell :sh Both A and C

16. Whats the exit status of an unsuccessfully executed command? A. B. C. D. Zero Non-Zero NULL None of the above

17. [ -e fname ] is A. B. C. D. True if fname is a directory, otherwise false True if fname has the execute permission, else false True if fname length is greater then 0, else false True if fname exists, otherwise false

18. If we want to make a shell variable available to the child shells then A. B. C. D. It should be imported Just use it once Export the variable Just declare it

19. Analyze the following shell script and conclude its working if [ $# -ne 2 ] ; then echo Usage:$0 source destination ; exit elif [ ! d $2 ] ; then echo directory $2 doesnot exist else file=$1 if [ ! f $2/$file ] ; then cp $1 $2 else copies=1 while true ; do if [ ! f $2/$file.$copies ] ; then cp $1 $2/$1.$copies echo File $1 copied to $1.$copies break else copies=`expr $copies+1` fi done fi fi

A. B. C. D.

Copies a file given as an argument to the directory specified on the command line Calculates the number of files present starting with the same name Copies a file into a directory. If file exists in the directory than copies it as file.1, if file.1 exists than copies it as file.2 and so on None of the above

20. If a variable is not set, I want to give it a default value. Which one of the following will do the work? A. B. C. D. ${parameter-default} ${parameter=default} ${parameter+value} ${parameter?msg}

21. What is ping command used for? A. B. C. D. Its a game in Linux A command to find out the value of PI To check connectivity between two systems None of the above

22. In the command combination cat file1.txt | wc c, | is known as A. B. C. D. Bar Socket Connector Pipe

23. To see all the user and system process the command is A. B. C. D. ps f ps e ps u ps -t

24. Which of the following command will kill the process surely A. B. C. D. kill -9 <Pid> kill KILL <pid> kill force <pid> Both A and B

25. What does the file with extension .tar.gz specify? A. B. C. D. A compressed file A packed file A packed and compressed file None of the above

Você também pode gostar