50 INTERVIEW QUESTIONS FROM LINUX COMMANDS WITH ANSWERS FOR FRESHERS
a) date +%d/%m/%Y
b) date +”%d/%m/%Y”
c) date +/%d/%m/20%y
d) date +”/%d/%m/20%y”
2. The command syntax to display the file ‘sample.txt’ one page at a time is
a) man sample.txt>more
b) cat sample.txt<more
c) cat sample.txt|more
d) None of the above
3. Which one shows the name of the operating system?
a) uname -n
b) uname -r
c) uname -o
d) uname –m
4. How do you add (append) a file “file1” to the example.tar file
a) no you cannot add a file to example.tar
b) tar -cvf example.tar file1
c) tar -rvf file1 example.tar
d) tar -evf file1 example.tar
5. How to execute ls command inside a vi editor?
a) !ls
b) :ls
c) :!ls
d) we can’t execute
6. Which command gives the first byte where the difference is in the file1 & file2?
a) diff
b) cmp
c) comm
d) ls -a
7. To open a file file1 with cursor at line number 4
a) vi +num file1
b) vi +set num file1
c) vi + “set num” file1
d) vi +/se nu file1
8. sed is a command typically used for
a) Perform complex calculations
b) Perform FIFO based non-blocking I/O
c) Modify/print selective contents of a file
d) None of the mentioned
9. What communication command provides communication to another user logged on by writing to the bottom of their terminal?
a) talk
b) write
c) chat
d) transmit
10. Which screen manipulation command sets the screen back to normal?
a) tput cup
b) tput smso
c) tput rmso
d) tput blink
11. Which command will you use to see the available routes?
a) show route
b) route status
c) netstat -r
d) none of the mentioned
12. The dmesg command
a) Shows user login logoff attempts
b) Shows the syslog file for info messages
c) kernel log messages
d) Shows the daemon log messages
13. The command “mknod myfifo b 4 16”
a) Will create a block device if user is root
b) Will create a block device for all users
c) Will create a FIFO if user is not root
d) None of the above
14. Which command is used to set terminal IO characteristic?
a) tty
b) ctty
c) ptty
d) stty
15. Which command is used to record a user login session in a file
a) macro
b) read
c) script
d) none of the above
16. Which command is used to display the operating system name
a) os
b) Unix
c) kernel
d) uname
17. Which command is used to display the unix version
a) uname -r
b) uname -n
c) uname -t
d) kernel
18. Which command is used to print a file
a) print
b) ptr
c) lpr
d) none of the above
19. Using which command you find resource limits to the session?
a) rlimit
b) ulimit
c) setrlimit
d) getrlimit
20. Which option of ls command used to view file inode number
a) –l
b) -o
c) –a
d) –i
21. find / -name ‘*’ will
a) List all files and directories recursively starting from /
b) List a file named * in /
c) List all files in / directory
d) List all files and directories in / directory
22. Which command is used to display the octal value of the text
a) octal
b) text_oct
c) oct
d) od
23. Which command is used to view compressed text file contents
a) cat
b) type
c) zcat
d print
24. Which command changes a file’s group owner
a) cgrp
b) chgrp
c) change
d) group
25. Which command is used to extract intermediate result in a pipeline
a) tee
b) extract
c) exec
d) none of the above
26. Which command is used to extract a column from a text file
a) paste
b) get
c) cut
d) tar
27. Which command is used to display disk consumption of a specific directory
a) du
b) ds
c) dd
d) dds
28. Which command is used to perform backup in unix?
a) backup
b) cpio
c) zip
d) gzip
29. Which command creates an empty file if file does not exist?
a) cat
b) touch
c) ed
d) read
30. Which option of rm command is used to remove a directory with all its subdirectories
a) –b
b) –o
c) –p
d) –r
31. Which command is used to identify file type?
a) Type
b) File
c) Finfo
d) Info
32. Command used to determine the path of an executable file is
a) which
b) where
c) wexec
d) what
33. Command used to count number of character in a file is
a) grep
b) wc
c) count
d) cut
34. Which of these commands could you use to show one page of output at a time?
a) less
b) sed
c) pause
d) grep
35. Which commands will give you information about how much disk space each file in the current directory uses?
a) ls -l
b) ls -la
c) du
d) ls -a
36. Which of the following command output contains userid?
a) ls
b) help
c) date
d) ls –l
37. Which command is used to display all the files including hidden files in your current and its subdirectories ?
a) ls –aR
b) ls –a
c) ls –R
d) ls –l
38. Which of the following commands can be used to copy files across systems?
a) ssh
b) telnet
c) rsh
d) ftp
39. pwd command displays
a) user password
b) password file content
c) present working directory
d) none of the mentioned
40. Which of the following commands can be used to change default permissions for files and directories at the time of creation
a) Chmod
b) Chown
c) Umask
d) Chgrp
41. Which tar command option is used to list the files in a tape archive format?
a) cvf
b) tvf
c) xvf
d) ovf
42. Which of the following commands will allow the user to search contents of a file for a particular pattern
a) touch
b) grep
c) find
d) ls
43. Which of the following commands is expected to rename a file from ABC to file XYZ?
a) mv ABC XYZ
b) move ABC XYZ
c) cp ABC XYZ
d) rm ABC XYZ
44. Which of the following structures on the disk stores the attributes related to a file?
a) inode
b) Data block
c) Block in a file
d) Directory
45. How many links can get created for a new directory?
A)1
B. 2
C. 3
D. 4
46. Which of the following statements will stand false, if a user creates a link to a file using the command
A. Both the files have the same iNode number.
B. The number of links for file1 is 1.
C. The number of links for file1 is 2.
D. The number of links for file2 is 2.
47. What happens if we delete a file carrying two hard-links say h1 and h2 and one soft-link say sl?
A)We will be able to access the file with hl and h2 but not with sl.
B. We will not be able to access the file with hl and h2 but with sl.
C. We will be able to access the file with any of hl, h2 or sl.
D. We will not be able to access the file with any of hl, h2, and sl.
48. Which of the following inode structures have two files (belonging to the same partition) pointing to it?
A)Soft links
B. Hard links
C. Alias
D. Special files
49. Which of the following statements is true about the creation of hard links pointing across partitions?
A)Allowed only to root user.
B. Can be done by all users.
C. The effects are unspecified.
D. Not allowed.
50. Where are the printer devices rests in a Linux file system?
A)/etc
B. /dev
C. /lib
D. /printer
To Download Answers Click The Below Link