Sei sulla pagina 1di 6

Basi Unix

1. 2. 3. 4.

Final Test

Batch 6

Time 120 Min

Explain echo command with examples. (1) How do find system boot and up times? (1) Compare telnet with ssh (1) Write steps to store outputs of following command in file fout. (1) Who,date,ls,id

5. Write rule for naming a file in unix. (1) 6. Explain five options in who command. (1) 7. Explain cd commad. (1) 8. How do rename a file. Give an example. (1) 9. Explain UNIX directory structure. (1) 10. Explain about Operating Systems? (3) 11. Write few flavors of UNIX. (1) 12. Write a command to find inode and time stamps of file filea and fileb (1) 13. List all two character user commands. (1) 14. If i am changing my umask value to 0777. can i create a folder and file ? (1) 15. How to logon to a unix host? (1) 16. How to send messages to user currently logged in? (1) 17. How to check in what flavour or version of unix is working? (1) 18. How to change the password? (1) 19. How to check the current directory I am working? (1) 20. Which file to be edited by user to display some messages for him self while login in? (1) 21. How to check which user in my /home directory is occupying more space & how to get the maximum space using directory & size on top of the output? (1) 22. What are all the command can be used to logon from one unix host to another host? (1) 23. Which command to be used to find, what type of file is /etc/passwd? (1) 24. How to check what is my current allocated path? (1) 25. How to append /home/alex/bin to existing path & which file to be edited to make it available on every login? (1) 26. What command to be used, to know in which shell I am currently working? (1) 27. What command to be used for logout from a unix host? (1) 28. What are type of shell? (1)
29. List the available shells in your system. (1) 30. What are the commands that list the value of a specific variable? (1) 1.echo $PATH 2.env $PATH 3.printenv $PATH 4.All of the above 31. Get all the users names whose first character in their login is g. (1) 32.Display your processes only( username is user1)? (1) 33. Explain about umassk command. (2)

34. Explain all columns in the output of ls l

command

(2)

35. What is the simple command to change to the home directory from /usr/sbin? (1)

36. Explain the following (3) Chmod -r 246 done Chmod u=w,g=r,o=rw ftwo Chmod o-rw,u+rw,g+x three 37. Display third and fifth columns from lines 20 to 30 of /etc/passwd file 38. Explain five options in who command. (2) 39. Isting files with the following condition (1) a) Start with a,f,q and 5th character is b and last character is q. b) Files which are not start with a to k and only 4 character length 40. What will the following command match ( 1) $ ls ???[!a-z]*[0-9]t 41. Locate files which are modified one year ago and permissions are 741 (1) 42. List 3 commands that can be used to view the contents of a file. (1) 43. Copy all folders one,two,abc into total in tmp directory (1) 44. Explain about local and global profiles (2) 45. Explain the following (2) a) $? b) $$ c) && d) ||
46. $ command & executes the process in (1) A) Server B) foreground C) & is treated as a option D) background 37. cat file1 >file2 2>file3 (1)

(2)

A) redirects errors of file2 to file3 B) redirects the error to file2 only C) redirects the output to file2 and errors if any to file3 D) None 38. How do you set an alias? Give example

(1)
(1)

39. Standard input file in UNIX is represented by number A) 0 B) 1 C) 2 D) 3 40. What is the meaning of the following command? $ cat file1 1> file2 (1)

A) Copies error to file1 B) Copies error to file2 C) Copies file1 to file2 41 Command used to copy & paste a line in vi editor is A) 'yy' to copy and 'p' to paste C) 'c' to copy and 'q' to paste B) 'dd' to copy and 'p' to paste D) None (1)

42. Command used to resume a suspended process to background is (1) A) bg PID B) fg PID C) bg %jobid D) background PID 43. Consider these are three files available in the current working directory (1) drwxrwxrwx 2 bms jnc 4096 Feb 28 12:13 temp drwxrwxrwx 2 bms jnc 4123 Feb 28 15:40 new -rwxr-xr-x 1 bms jnc 96 Feb 28 16:23 test What will be the output after executing the following command ? $ ls -l | grep dr | wc -l A) 3 B) 2 C) 4 D) 5

44. date >> date.lst What is the output of this Command? (1) A) Redirects the date to file date.lst B) Displays the date and redirects date to dat.lst C) Appends the date to file date.lst D) None 45 su root will (1)

A) Switch to root account with maintaining old users environment B) Switch to root account with invoking new users (root) environment C) Will fail to switch the account 46. Command used to change the password is (1)

A) chgpassword B) chgpass C) passwd D) changepass 47 What does the following command do? cut f3 d: file1 | sort -r A) Displays the third column of file1 sorted in descending order B) Displays the third column of file1 sorted in ascending order. C) The command sequence does not work properly (1)

48. Java package is installed in /usr/local/java/jdk1.6/bin. How do you set the path? (1)
49. How do you grant read permission for group, for a file named "sample"? A) chmod g+b sample B) chmod g+r sample C) chmod g+s sample D) None (1)

50. Any filename preceded by a . is a hidden file in Unix A) true B) false 51 The l bit appears in ls l output for (1)

(1)

A) soft links B) hard links C) named pipes D) device files 52 [abc] (1)

A) Matches a single character which is not a, b or c B) Matches a single character either a, b or c C) Matches the pattern abc at the beginning of the line D) Matches the pattern abc at the end of the line 53 Which of the following will return current months calendar A) echo cal (double quotes) B) echo Today is:cal (single qotes) C) echo `cal` (back quotes) D) echo cal 54. rwxr-xr-x To change the permissions on a shell script testfile.sh to rwxr--r, youll use the command (1) A) chmod 777 testfile.sh B) chmod 744 testfile.sh C) chmod 755 testfile.sh D) chmod 700 testfile.sh (1)

55. What is the difference between the two commands below?

(1)

(a) who | tail +1 (b) who


55 Which is the configuration file of vi which is read at every invocation? A) .virc B).exrc C) .profile D) None of the above 56. Which of the following is the strongest signal that can be sent to a process? (1) A) 1 B) 2 C) 9 D) 15 57 Which file in linux is used to store user specific aliases. A) .bash_profile B) .profile C) /etc/profil D) .bashrc 58 ^C (Ctrl+c) will send (1) (1) (1)

A) Signal 1 B) Signal 2 C) Signal 15 D) Signal 9 59 Which of the following are used to remove the special meaning of shell metacharacters? (1)

A) square braces B) back quotes C) backslash D) curly braces 60 How would you navigate to the 23rd line of a file in vi? A) 23dd B) 23yy C) 23g D) None of the above 61. Explain the following (2) (1)

$ cat .profile > newprofile 2>1


62. Which one is the default shell in LINUX A) ksh B)bash C) tcsh D) sh 63. Which of the following commands to list the system variables A) env B) echo `env` C) printenv D) All of the above 63. Write the command for finding all files are modified on before 2 days 64 . Find the word, the character start with the number in a file filec 65. List the userids of the currently logged user. (2) (1) (1). (1) (1)

66 Find the username those who are having uid higher then 500? (3) 67. Write the command to display the runlevel? (1) (1)

68. Which of the following commands used to create a hardlink to a directory A) ln -s dir1 dir2 B) ln dir1 dir2 C) ln -a dir1 dir2 D) none of the above 69. What

is the difference between kill and kill -9 (2)

? (2)

70.

Show files by size, biggest last

71. Write a command to show disk partitions sizes and types (2)
72. Explain the following (2)

ls -l ~ | grep -v "^d" | awk '{print $5, $8, $3, $6, $7}' 73. . Which command would you use to find out when a particular user logged in? a. $ who am i b. $ who c. $ finger everyone d. $ finger username (2)

74. What are other commands that can be used to communicate with other users? (2) 75. . List commands that can be used to view the contents of a file. (2)

76. The following questions are for a file called reporta which has the following set of permissions: rwxr-xr-x (5) a) What is the mode in octal? b) Change mode to rwxr- - r- - using the symbolic format. c) Repeat the above operation using the octal format. d) Question four is based on the following listing. Assume that the directory jobs contains the file joblog. $ ls -lR total 8 dwxr-xr-x 2 judy finance 512 June 5 11:08 jobs ./jobs: total 8 -rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog Can Fred, who is a member of the finance group, modify the file joblog? e) Question five is based on the following listing. Assume that the directory jobs contains the directory work, which in turn contains the file joblog. $ ls -lR total 8 drwxrwxr-x 3 judy finance 512 June 5 11:08 jobs ./jobs: total 8 drwxrw-r-x 2 judy finance 512 June 5 11:10 work ./jobs/work: -rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog Can Fred, who is a member of the finance group, modify the file joblog?

Potrebbero piacerti anche