The document discusses Linux operating system basics including commands for directory navigation (cd, cd ..), file manipulation (ls, rm, cp, mv), permissions (chmod), users (whoami, su), processes (ps, kill, top), and utilities (grep, find, diff). It also covers Linux internals like system libraries, the init process, and scheduling algorithms. The second part discusses Unix fundamentals such as shells, multitasking, files/directories, and POSIX standards.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
379 views
Linux MCQ
The document discusses Linux operating system basics including commands for directory navigation (cd, cd ..), file manipulation (ls, rm, cp, mv), permissions (chmod), users (whoami, su), processes (ps, kill, top), and utilities (grep, find, diff). It also covers Linux internals like system libraries, the init process, and scheduling algorithms. The second part discusses Unix fundamentals such as shells, multitasking, files/directories, and POSIX standards.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5
Linux OS, Basic OS Internals i.
Default interface to Linux (31) What command is used to
and Shell Commands (16) Which binary format is summarize the disk usage? supported by Linux? i. du (1) Which command is used to i. Both a.out and ELF (32) Which Linux command is used move one level up in the Linux (17) What command is used with vi for renaming files and directory tree? editors to append text at the directories? i. cd .. end of line? i. mv (2) ________ are special functions i. A (33) _______ command is used to or programs using which (18) Which command in Linux is remove the contents of your application programs accesses used to display information terminal. Kernel's features. about files and directories i. clear i. System libraries contained within the current (34) In Linux _____ command is (3) What command is used to working directory? used to switch to the remove the directory? i. ls administrative account in the i. rmdir (19) What command is used to sort current login session. (4) Which of the Linux command- the lines of data in a file in i. su line commands listed below is reverse order? (35) Which command will ensure used for directory traversal? i. sort - r that everything in the buffer is i. cd (20) ________ command is used to written to disk? (5) _____ command is used change his /her own password i. sync to move the cursor back to the in Linux. (36) What is the purpose of beginning of the preceding i. passwd “chmod” command in Linux? word. (21) _____ command is used to i. Changes file access i. b count the number of lines in a permissions (6) What is the purpose of ls file. (37) Which of the following is not a -a command in Linux? i. wc - l communication command? i. View all files (22) What command is used to i. grep (7) Which of the answers listed print a file? (38) What command is used to below refers to a Linux i. lp display your current command for copying files and (23) What command is used to username? directories? count the number of i. whoami i. cp characters in a file? (39) Which of the following (8) Which command is used to i. wc - c command is used to mount change the permission of a (24) Which of the following NFS filesystems? file? command is used to turn off a i. mount i. chmod Linux host? (40) What command is used to (9) The maximum file name size in i. Shutdown display the top of the file? Linux is 255 bytes. (25) What command is used to i. head i. True compare the files? (41) ______ command will allow (10) The first process launched by i. cmp the user to create single or the linux kernel is (26) _______ command is used in multiple files, concatenate ___________. Linux for deleting files and files, and redirect output in i. Init process directories. terminal or files. (11) What is the need for the i. Rm i. cat chown command in Linux? (27) A low-level utility used for (42) Which Linux command is used i. Changes file owner and group creating/restoring filesystem to display an absolute path (i.e. permissions backup copies in Linux is full filename ) to the current (12) A Linux command-line utility called__________. working directory? used for displaying and i. dd i. pwd modifying network interface (28) A Linux command that allows (43) What is the core of a Linux configuration settings is user to modify security Operating System? called________. privileges in order to execute a i. Kernel i. ifconfig single command that requires (44) Linux uses a time-sharing (13) Which of the following key root access permissions is algorithm ___________ . combination will allow the user called_______. i. To pair preemptive to terminate a current process i. sudo scheduling between multiple in the Linux shell? (29) Which of the following is a processes i. Ctrl + C feature of Linux? (45) What command is used in the (14) To remove non- i. Multiuser, Multitasking vi editor to delete a single empty directories and all the (30) What command is used to character? files within them, use the rm show all the i. x command with the last commands that have been ____ option. recently used? i. -r i. history (15) What is Shell used for? Basics of Unix, Files (18) Which of the following is not a System and Directory part of all the versions of Management UNIX? i. Graphical user interface (1) Which shell operator can be (19) Which command is used to used to place a command to change the group owner of the execute in background? file? i. & i. chgrp (2) What is UNIX? (20) Shell is a command interpreter i. an operating system used for interacting with a (3) A single user can have the UNIX system. computer work on more than i. TRUE one task or program at the (21) POSIX is a set of standards same time. specified for establishing i. multitask compatibility between (4) For creating and removing operating systems. directories, which of the i. TRUE following system calls are (22) The part of the Unix operating used? system that interacts with the i. mkdir and rmdir hardware is called (5) In a tree structure, when i. The kernal deleting a directory that is not (23) Which command is used for empty? printing the current working i. The contents of the directory directory? are also deleted i. pwd (6) An absolute path name begins (24) What does the following at the _____________ command do? i. root $ mkdir dir dir/dir_01/dir_02 (7) A tree structure ______ the i. create dir, dir_01 and dir_02 sharing of files and directories. (25) When we log in, the UNIX i. restricts places us in a directory, called (8) Choose the odd one out. ______ directory i. kernal i. home (9) A relative path name begins at (26) Which part of the UNIX the _____________ operating system interacts i. current directory with the hardware? (10) cd command cannot be used i. Kernel without any argument. (27) Two UNIX systems may or may i. FALSE not use the same set of system (11) Which path is refers to the calls. exact path as referenced from i. FALSE the root directory. (28) The shell does the following in i. Absolute path Unix (12) _____ and _____ cannot be i. Is the user interface used in a filename. (29) Which command is used to list i. /, NULL all the files? (13) Multiple directories can be i. ls removed using single rmdir (30) Which command is used for command. creating directories? i. TRUE i. mkdir (14) The root directory is represented by ___ i. / (15) Which of the following is not a feature of UNIX? i. easy to use (16) Which command is used for changing the current directory? i. cd (17) In which language UNIX is written? i. C Commands in Unix (16) Which of the following files contains information related to (1) Which command is used to password aging? sort the lines of data in a file in i. password reverse order (17) Which of the following is not a i. sort -r filter? (2) Which command is used to i. None of these (cat, grep, wc, display the top of the file? sort) i. head (18) Which of the following (3) Which symbol will be used commands is used to count the with grep command to match total number of lines, words, the pattern pat at the and characters contained in a beginning of a line? file. i. ^pat i. wc (4) Which command is used to (19) Which of the following extract specific columns from commands is used to identify the file? the type of file by context? i. cut i. file (5) The command which (20) Which command is used to transcribes the standard input display and create files? to the standard output and i. cat also makes a copy of the same (21) Which of the following in a file is commands is used to have a i. tee two-way communication with (6) Which of the following any person who is currently commands is used to update logged in? access and modification times i. write of a file? (22) Which of the following i. tough commands can be used to get (7) Which of the following files will information about yourself? displayed by this command cat i. who am i *ch* (23) The command that can be i. None of these (patch, catch, used to restrict incoming .ch) messages to a user is (8) Which of the following i. mesg command addresses all users (24) Which command is used to who are currently hooked on? display the end of the file? i. wall i. tail (9) Which of the following is not a (25) Which of command is used to communication command. copy a file? i. grep i. cp (10) Which command is used to (26) Which command is used to link display the characteristics of a the files? process? i. ln i. ps (27) Which command is used to (11) Which command is used to display the device name of the sort the lines of data in a file in terminal you are using? alphabetical order? i. tty i. sort (28) Which of the following (12) Which of the following commands can be used to get commands is used to view information about all users your file 24 lines at a time? who are currently logged into i. pg the system? (13) The command used to i. who compare the files is known as (29) Which command is used with i. cmp vi editor to move cursor (14) Which command is used to forward to first occurrence of terminate a process? character 'ch' in the current i. kill line? (15) Which of the following i. Fch commands is used to (30) Which of the following summarize the disk usage? commands is used to remove i. Du files? i. rm VI - Editor Commands (19) Pressing ‘:’ in command mode invokes which mode of vi (1) In vi editor ctrl-l is used to? editor? i. clear the screen i. ex-mode (2) In a system, if 5 people are cur (20) ____ command moves the rently using the vi editor. then cursor to the end of next line. the number of corresponding p i. $ rocesses will be (21) vi environment is determined i. 5 by variable settings. These (3) Which editor is used by the variables are controlled by UNIX system to edit files? ____ command. i. vi i. :set (4) To save a file and remain in vi (22) The run control file in Vi is editor, which one of the called following command will be i. .exrc used? (23) t command positions the i. :w cursor a single character (5) We can perform word before the occurrence. navigation in vi editor. i. True i. True (24) The editor that is nearly as (6) To clear the screen in vi editor, important as the Vi editor is _____ is used. i. Emacs i. ctrl-l (25) For searching a character, ___ (7) How can we escape to the and ___ are used. UNIX shell without quitting vi i. f, t editor? (26) Use the following command to i. using ‘:sh’ command and using save and exit from Vi. ctrl-Z i. d. Both a and b (ZZ, :wq) (8) What is the default mode of vi (27) For customizing vi, which of editor? the following command is i. Command mode used? (9) Which key is used for deleting i. set, map, abbr text? (28) Which symbol is used for i. d repeating the last command? (10) Copying is referred to as i. . yanking in vi editor. (29) Which operator is used in vi to i. True filter text? (11) In vi editor, the key i. ! combination CTRL+f (30) vi editor stores most of its i. moves screen down one page information in a hidden swap (12) Which of the following file. symbols are used for searching i. True a pattern in vi? i. / and ? (13) Which command is used to redo the changes made by the undo command? i. ctrl-r (14) To copy (yank) lines in vi editor, we use ______ command. i. yy (15) The Vi editor has 2 separate modes i. Insert and edit (16) Which command searches the string in file opened in vi editor? i. / or ? (17) Which operator is used to show unused line in VI editior? i. ~ (18) vi commands are not case sensitive. i. False Shell Scripting Basics (1) To spawn a child of our own choice for running the script, we can use the ______ command. i. sh (2) Which of the following is used for storing the number of positional parameters? i. $# (3) Command-line arguments are stored into positional parameters. The first argument is read by the shell into the parameter ______. i. $1 (4) Choose the command to print the current working directory. i. pwd (5) A single read statement can be used with one or more variables. i. TRUE (6) Which character can be used to separate two commands on the same line? i. ; (7) Shell scripts need to be saved with an extension (.sh). i. FALSE (8) What is the command to display the ‘file’ contents page- wise? i. cat file|more (9) Which command is used for making the scripts interactive? i. read (10) In general, the working directory of the user root is ______. i. /root (11) To run the script, we should make it executable first by using ______. i. chmod +x (12) The first line in any shell script begins with a ______. i. # (13) Choose the correct option to replace all the occurrences of pattern1 with pattern2 using vi editor. i. %s/pattern1/pattern2/g (14) What is a shell script? i. a file containing a series of commands (15) Which of the following is correct to create an alias name for 'ls' as 'list'? i. alias list=”ls”