UNIX UCF DUMP_1

9
Introduction to unix which of the following statements is not true operating system is a substitute for f which shell execute commands using C programming language like syntax : csh which component handles interrupt and trap handling, system clocks, scheduling, file descriptor, etc. kernel which is the common kernel name? genunix Default shell of UN! c,korn,bourne what is the core of the operating system and talks directly with the hardware : kern which of the following is a filesystem supported in UN!? all of the abo"e which of the following is a type of file in Unix all of the abo"e which is not a file in Unix none of the abo"e *which component of operating system allows the end user to interact with the computer directly #shell *which is not a unix shell yp *what is $sbin commonly used for? system binaries *%hich of the following is false? Default shell is always &$usr$bin$sh& and can't be modi Access Files & directories (he command used to see data flow in ftp: hash %hen you run ls )la to list the file, you find &rw)&, what it means ? read and write but no execute %hich of the following tool$utility cannot be used to login to a Unix system N*+ what does the command &grep unnec $usr$share$dict$words& return ists all words that has keyword &unnec& in the file$usr$share$dict$words what will pwd command return present working directory what happens when cd $usr is executed changes the current directory to $usr *what is the octect number, with respect to permissions for rwxr)xr)) - / *which command can tell you if the file has 0or is 1 a soft link ls *what is the possible output for &cat test2& command? contents of the file called test2, *which command cannot be used for seeing filesystem utili3ation ls *4emo"e or delete * 5 ? rm * 5 %hat are the contents of lib directory 5ssential shared libraries and kernel modules %hat is special about hidden files their filename begin with a dot which command will change the password of the user? passwd %hat happens when &ls ..$& command is executed when the user is currently in $usr$local$bin t will list the content of $usr$local which command is used to change file ownership chown what method cannot be used to logout from a unix system type out at unix shell what will the below command return ) find $etc )name passwd )print ? $etc$passwd what is the octect number, with respect to permissions for rwxr)xr)x - %hat is most basic file systems in UN! U*+ f you execute chmod --6 to a file that you own, the file permission will be )rwxrwx))) which is not a "alid filename in Unix none of the abo"e which command searches the user's entire searchpath as defined in the 78(9 which what is the most probable output for ls c all files and directories beginning with c which is one of the property of hard link? cannot span across filesystems

description

UNIX UCF DUMP_1

Transcript of UNIX UCF DUMP_1

Introduction to unix which of the following statements is not true operating system is a substitute for firmware which shell execute commands using C programming language like syntax : csh which component handles interrupt and trap handling, system clocks, scheduling, file descriptor, etc. kernel which is the common kernel name? genunix Default shell of UNIX c,korn,bourne what is the core of the operating system and talks directly with the hardware :kernel which of the following is a filesystem supported in UNIX? all of the above which of the following is a type of file in Unix all of the above which is not a file in Unix none of the above *which component of operating system allows the end user to interact with the computer directly ;shell *which is not a unix shell yp *what is /sbin commonly used for? system binaries *Which of the following is false? Default shell is always "/usr/bin/sh" and can't be modified

Access Files & directories

The command used to see data flow in ftp: hash When you run ls -la to list the file, you find "rw-", what it means ? read and write but no execute

Which of the following tool/utility cannot be used to login to a Unix system NFS

what does the command "grep unnec /usr/share/dict/words" return Lists all words that has the keyword "unnec" in the file/usr/share/dict/words

what will pwd command return present working directory what happens when cd /usr is executed changes the current directory to /usr *what is the octect number, with respect to permissions for rwxr-xr-- 754 *which command can tell you if the file has (or is ) a soft link ls

*what is the possible output for "cat test1" command? contents of the file called test1, if file exists *which command cannot be used for seeing filesystem utilization ls *Remove or delete FILE ? rm FILE What are the contents of lib directory Essential shared libraries and kernel modules What is special about hidden files their filename begin with a dot which command will change the password of the user? passwd What happens when "ls ../" command is executed when the user is currently in /usr/local/bin It will list the content of /usr/local which command is used to change file ownership chown what method cannot be used to logout from a unix system type out at unix shell what will the below command return - find /etc -name passwd -print ? /etc/passwd what is the octect number, with respect to permissions for rwxr-xr-x 755 What is most basic file systems in UNIX UFS If you execute chmod 770 to a file that you own, the file permission will be -rwxrwx--- which is not a valid filename in Unix none of the above

which command searches the user's entire searchpath as defined in the PATH which what is the most probable output for ls c* all files and directories beginning with c which is one of the property of hard link? cannot span across filesystems which command creates soft link ln -s what is the possible output for "echo test1" command? displays "test1" on the screen chose the odd man out from the four entries cat which of the following statement is true all of the above

What does /etc directory have? host config files what happens if the cd command is executed without any parameters on a Unix shell It changes to the home directory of the user executing the command what happens when cd ~unix is executed navigates to the home directory of the user, called "unix" which option is not available directly with find command? to search based on the password of the user which is one of the property of soft link? can span across filesystems *which command creates hard link without any option ln *what is file command used for? gives the type of data based on code at the beginning of the file

*what is the minimum permission required to read a fileread permission for the file and all parent directories above the directory where file resides

Editors *What is the expansion of sed? stream editior *To find and replace the word "Moon" to "Sun" only the first occurance word in the file old is? sed '/s/Moon/Sun/' old The default mode of VI editor is? Command mode The command to save the file focefully is? :w! The command to quit the vi editor without saving the file is? :q The command 3dd in the VI editor command mode_____. Deletes three lines from current cursor position downwards The command to redo the change in VI editor is? ctrl-r Another way to save your changes and exit out of VI is______, It is the simplest way for the same. zz ______ command deletes from current cursor position to the beginning of the line in VI editor. d^ The command to enter insert mode in a new line above the current cursor position in VI editor is? O The command that will recover a file after an unexpected interruption in VIeditor is? :recover To find and replace the word "Moon" to "Sun" globally in the file old is? sed '/s/Moon/Sun/g' old The command to delete the word "Moon" in the file old is? sed '/s/Moon//g' old The key to switch from Insert to Command mode is? Esc The command to undo most recent change in VI editor is? u ______ command deletes from current cursor position to the end of the line. d$ The command to enter insert mode in a new line below the current cursor position in VI editor is? o

The command used to change a to A and b to B simultaneously in the file old is? sed -e 's/a/A/' -e 's/b/B/' old The key to switch from Command to Insert mode is? I or i or a The keys used to move the cursor let, right, up and down in VI editor is? h, l, k and j The command to copy text in VI editor is? y The command to search a string in the VI editor is /string What are the two modes of VI editor? Command, Insert mode The VI editor has how many buffers for storing pieces of text? 36 ______ command letes from current cursor position to the end of the word. dw

Print services

*The profile file for a bash shell is .bashrc The command sends a job to the queue to be printed lpr The service running for printing service is cupsd Command to print a file with multiple copies lp -n num-copies filename Command to print a file with multiple copies lpr # num-copies filename Advanced version of VI editor is vim The passwords are stored in the file /etc/password The /etc/shadow file contains encrypted password and it is a read-only file. TRUE The /etc/password file stores group information or defines the user groups TRUE The profile files are created under Home directory of the user The profile files can be listed with ls option ls -a The configuration file for cups service is /etc/cups/printers.conf Command to print a file on both sides of the paper lp -o sides=two-sided-long-edge filename Command to print a file on both sides of the paper lpr -o sides=two-sided-long-edge filename The /etc/password file contains encrypted password. FALSE The profile file for a csh shell is .cshrc The command to removes a print job from the queue lprm or cancel jobid Command to list of configured printers? lpstat -a Gaphical version of VI editor is gvim

Handling IO *Which of the following is used for background Jobs & For suspending, Re-starting and terminating background jobs which of the below mentioned character can be used with % Which of the following statement is true?The descriptor and the redirection operator must be written as consecutive characters Which of the following commands creates a Bash subshell? bash Which of the following is the descriptor of the standard input stream? 0 Acronym for grep global regular expression print egrep stands for Extended grep Which of the below option in grep can be used to print a list files that contain at least one line matching the pattern? l To select the lines beginning with an uppercase character and ending with ! egrep ^[A-Z.*\!.$ file To find out wipro is currently logged into the system, choose the correct one? $ who | grep wipro What is meaning of command >&2? Redirects stdout of command to stderr. How do you redirect both stdout and sderr the script to file name? command &>filename How to discard error for the command? find / -name "*" -print 2> /dev/null What is $*? Its mainly used for showing up all parameter values passed in shell script. Which statement is true as for as backslash (\)character is concerned The backslash character changes only one character the one immediately following it | is a? Operator Pipe operator symbol is | In which of the below option appends the value of data to the file named file1? date >> file1 Which of the following commands displays your login shell? echo $SHELL Which of the following commands creates a C subshell? csh Which of the following is the descriptor of the standard output stream? 1 In general grep writes the output to Monitor Which of the following not belongs to the grep family? rgrep Based on which criteria grep utility is working? pattern i option with grep is used for? Ignores upper/lowercase in matching text To ignore uppercase/lowercase in the matching text, which option can be used with grep? i Most Powerful grep Utility - choose the best one egrep In grep, which of the below is correct one of the regular expression that is the complement of the given criterion instead of the criterion itself? grep v pattern file_name To count the number of blank lines in the file called file1, which one is the correct answer? egrep c ^$ file1 If the regular expression contains more complex search pattern means which is the best one to use with? egrep To count the number of non-blank lines in a file, which one is the correct? egrep c . File

Which of the following commands show your current shell? echo $0 Odd man out for grep Variables Limitations of grep utility All the above In grep Utility, the following option can be used to print only lines that entirely match pattern x Regular expressions in the grep family All the above Standard error is associated with Monitor Which of the below is termed as commandsubstitution character $ Which of the below is termed as Redirection substitution operator? >& Choose the output redirection error override from the given options who >| file1 Which of the following statement is true? All the above Which of the following commands creats a Korn subshell? ksh Which of the following is the descriptor of the standard error stream? 2 fgrep stands for All the above In grep, which of the following option gives an output of inverse output i.e.,prints the lines that do not match the pattern? v In grep Utility, to print only a count of the number of lines matching the pattern c To show the line number before each line in the output, which option can be used with grep Utility? n If the search criteria requires only sequence expressions, which of the grep is best Utility? fgrep To select the lines from the file called file1 that have the string OS All the above Find the odd man-out for redirecting standard output All the above Disk Management what is the command to list files from directory in decreasing order of their file size. du /directory_path | sort -nr Which command is used to limit filesizes limit Which command displays the size of a directory? du How do you search the a word 'unix' from a file 'file_name'? cat file_name | grep 'unix' Which command is used to uncompress compressed file uncompress Which command used to finds text within a file grep Which command is used list all files having a ".txt" extension ls *.txt Which command is used reducing an existing file to a file 'somefile' with the same name that is 0 bytes cp /dev/null somefile How do you send a mail message to somebody? mail [email protected] -s Your subject du stands for? disk usage in df -h commnad what is -h means Humanreadable If a file has permissions 000, then who can access the file? root Which command displays summary of disk space used in all the mounted file system? du -sk Which utility is used to reduce size of a file? compress Which command is used to create a new directory? mkdir What's so special about files and directories starting with a period? The are considered as hidden files/dirs Can you use > and | together? Yes What is the command to limit filesizes inC and Turbo c shell limit What is out of this command zip archivefile1 creates a file "archivefile1.zip" which contains a copy of all files in the current directory in compressed form. The process of reducing an existing file to a file with the same name that is 0 bytes large is called truncating What are the commands used to compress files in Unix COMPRESS, BZIP, GZIP and TAR Which command is used to seand a mail mail gunzip and zcat command are used to uncompress a compressed file Which command is used to display the last part of the file. tail Which command is used to delete all files in the current directory and all its subdirectories? rm -r * What is the command to fetch first 10 records in a file 'file_name'? head file_name Which command is used to Change to the home directory? cd What is the symbol | used for? pipe symbol connects output of one command to another command Which command you will use to count no of characters? wc Which directory you will create for your program files and scripts. bin Which command will display information about all mounted file systems df What does UID and GID signify? User ID and Group ID How to compress a file 'my_file' using gzip command? gzip myfile How do you search for a string 'computer' inside a directory? grep computer* Which command will add the suffix .gz to the filename and remove the original file when you compress a file gzip cat par.3 par.4 par.5 >> report What is the output of above command Writes the contents of the all 3 files into a file called report What is the syntax for zip command? zip file_name.zip file_name What is the command to limit filesizes in Bash or Korn shell ulimit Type the full command you could use to decompress the file "foo.gz" gzip -d foo.gz Which command will displays individual file sizes. ls -la How to compress file 'file_name' using compress command compress file_name Which is command is used to change permission of a file chmod Which command is used to Copy "fileA" to "fileB" cp fileA fileB How to display last 20 lines of a file 'file_name' tail -20 file_name . What is the functionality of tar command archives and extracts files to and from a single file called a tarfile. Give a file myfile.zip which command should you use to unzip? unzip myfile.zip How do you list currently running process? ps Which command is used to display current working directory? pwd How can you best see how much free space you have in your current directory? df .

Process Management What is "ps" command for? prints the process status for some or all of the running processes How would you kill a process? Using by kill command What are the process states in Unix? Choose the correct combination. Running,Waiting,Stopped,Zombie How can a parent and child process communicate? Through inter-process communication schemes (pipes, sockets, message queues, shared memory) Positive integer that uniquely identifies this process. process-ID It is system monitor tool. top Following command can be issued to send the kill signal to all processes. kill -9 -1 Which of the command displays or set scheduling parameters of specified proces ? priocntl The fork() creates new process called ? Child process To run a command in the background. Add the "&" character at the end of the comand line Expand the term IPC stands for ? Inter- Process Communication If kill() returns 0 This implies that a process exists with the given PID Command to change priority of a Process in Unix? nice What command can be used to wait and then resuming job execution sleep What is the command to delete a at job ? at rm or at -r option What is signal used by kill command ? SIGKILL Command which pauses until execution of a background process has ended. wait Command which kill a process by name. killall xfaces Which of the command is used to change the nice number of the task ? renice Which of the command sends a kill signal to PID. kill 0 What is a zombie state?The process is dead but have not been removed from the process table. How can you find dead processes? ps -ef | grep zombie Command executes commands at a given time. at What is command list at jobs ? at -l What is the command gives an overview of the hierarchical structure of all running processes? ptree Choose one valid SIGHUP command. kill -HUP Which of the option with uptime command will list the version information ? uptime -V What are various IDs associated with a process? PID,PPID,UID,EUID

How to check all running process in the unix system? ps -ef The command which displays how long a system has been running and some information about the current load. uptime kill all your processes except your current shell session. kill -9 System call responsible for splitting of a program into copies. fork() What is "waiting" process state ? The process is waiting for an event or for a resource If kill() returns 1 no process exists with the given PID What are signals in UNIX ? It is a message which can be sent to a running process What command can be used to display memory and swap use ? top What is the utility used to run a job regularly? cron At system startup the cron daemon searches for cron entries in which directory ? /var/spool/cron What is key combination causes the process to suspend execution? Ctrl-Z Signal sent to a process when its controlling terminal is closed. SIGHUP Which of the command suspends program execution for a specified period of time ? sleep Which of the system call is used to create an identical copy of a process ? fork The command which displays all the process of a user. pgrep -l -u userA

Which option with ps command will list information for all processes. ans ) ps -A In the nice command increment value must be in the range. 1-19 Which of the option will kill the most recently created "acroread" process ? pkill -n acroread What is the status field indicates for Zombie state? "Z"

Networking what is the port used for SSH ? 22 which are the FTP commands ? get, put, mget, mput what is the command to view the routing table ? netstat rn which protocol is used in traceroute udp network tool used to show the route taken by packets across an IP network ? traceroute what are the security concerns addressed on FTP ? Port Stealing,Sniffing what is SSH ? SSH is a protocol allowing command line access to a unix Difference between SSH and Telnet ?ssh data will be transfer between the systems in encrypted form ,telnet data will be transfer in alphabatical form. why ping command used ?ans ) Used to determine whether a route is experiencing packet loss, and to measure latency. SSH connections can be authenticated using ? passphrase what is Ping stands for ? ans ) PING : Packet Internet Gropper it's a diagnostic utility , which diagnose devices connectivity. Application layer protocol which allows data to be exchanged over a secure channel between two computers. ssh which command is used to connect Remote Host telnet which command is used to add the default gateway IP ? route add default The file is used to map port numbers and protocols to service names, /etc/services standard network protocol used to copy a file from one host to another over a TCP/IP-based network is FTP what is the port used for telnet ? 23 you can ping a server, but can't telnet or ssh to it, what could be the problem? telnet ,ssh ports and services are not enable what is the command to set binary mode to transfer the file using FTP > ans ) bin How to exit from FTP > bye if telnet is not running ? What need to be checked ? Need to check telnet daemons,ports are running. what is the command for printing for each data block transferred in FTP file transfer ? hash

what is the port used for FTP ? ans ) 21 how to make the ethernet interface disable ifconfig eth0 down which protocol is used to transfer the files ans ) ftp what is the command to be sounded after each file transfer is completed. bell A system administration tool and shortly know has interface configuration ? ifconfig

Job Scheduling how to disable crontab tasks ?insert # at the beginning of the line you want to stop for a while save and exit

which command executes the task at a specified time. at How to set the file transfer type If the file is readable text file ? ascii using a at command schedule a job to compile a C program at 11:35 a. m. on January 14 echo "cc -o foo foo.c" | at 1135 jan 14 Configuration file for a cron is crontab lists the user's pending jobs,number, date, hour, job class. atq Time-based job scheduler and used to automate system maintenance in unix cron

Unix utilities How will you execute backup and restore using the tar command in a single command ? tar cvf - /attachments/abc.txt | tar xvf - Which command provides an ongoing processor activity in real time? top You wish to restore the file memo.test which was backed up in the tarfile mybackup.tar. What command should you type? tar -xf mybackup.tar memo.test What utility can you use to show a dynamic listing of running processes? top The top utility can be used to change the priority of a running process?Another utility that can also be used to change priority is nice What command would you type to use the cpio to create a backup called backup.cpio of all the users' home directories? find /home | cpio -o > backup.cpio What does iostat do? Reports about I/O activity on the server. what is the SAR ? Displays the activity for the CPU what is TOP ? display a continually updating report of system resource usage. which command reports such as the system time, uptime, CPU usage, physical ans swap memory usage, and number of processes? TOP How do you get current CPU utilization, memory and disk space usage in Unix? iostat. Copies files into and out of archive storage and directories. cpio The utility found on all UNIX systems that monitors various system functions cpu,hard disk, process running ,terminal IO sar what is the command to display the Interface statistics ? netstat -i how to view only the device report using iostat command? iostat -d The command is useful in determining whether a physical volume is becoming a performance bottleneck and if there is potential to improve the situation. iostat what is SAR ? System Activity Reporter The Tool that does not impact the system performance while collecting the performance report ? sar what is the sar command options to check only the disk activity? sar -d The command that reports information about processes, memory, paging, block IO, traps, and cpu activity. vmstat what does the command iostat -xtc 5 2 ? extended data report at 5 seconds interval 2 times The command used to diagnose the network problems when the connectivity is there but it is slow in response . netstat -i what does options -d do in iostat command ? Display the device utilization report what does options -x do in iostat command ? Display extended statistics including disk utilization Which command (and options) will show the state of all sockets using netstat? netstat a

what does the SIZE refers to in the Top output ? refers to the virtual memory what does the RES refers to in the Top output ? refers to the resident memory used in the RAM You want to create a compressed backup of the users' home directories. What utility should you use? tar The "tar" command stands for ? tape archive which system monitor tool that produces a updated list of processes and CPU usage in most unix systems ? top using the cpio command what is the syntax to copy files onto diskette cpio -ov < filenames > /dev/rfd0 what is the command to see established and open TCP/UDP sockets ? netstat -a -n -f inet

You are covering for another system administrator and one of the users asks you to restore a file for him. You locate the correct tarfile by tar tvf tarfile

How to write the file1 and file2 files to a new archive on the default tape drive? tar -c file1 file2 You need to view the contents of the tarfile called MyBackup.tar. What command would you use? tar -tf MyBackup.tar

Account Management What is the file name where the default user SHELL variable is stored and used when adding a user /etc/default/useradd What does 'userdel -r User01' do ? Delete user User01 from system The gid for root group is : 0 To lock an account User01 you can issue command usermod -L User01

What is the command used to unlock account User01 passwd -u User01 Which method/command is recommended when you want to execute a command as another user - sudo Command to add existing user User01 to supplementary groups dev & test is useradd -G dev,test User01 What is the significance of the -m switch with su command (su -m) do not reset shell variables What is the command to delete an user account userdel -r login What is the command to create user oracle with default login group dba useradd -g dba oracle

What is 'su' command ? switch user The command to add dba group with gid 600 groupadd -g 600 dba