Linux VIVA Questions
Linux VIVA Questions
1. What is Linux?
Linux is an operating system or a kernel distributed under an open-source license. Its
functionality list is quite like UNIX. The kernel is a program at the heart of the Linux operating
system that takes care of fundamental stuff, like letting hardware communicate with software.
3. What is BASH?
BASH is short for Bourne Again SHell. It was written by Steve Bourne as a replacement to the
original Bourne Shell (represented by /bin/sh). It combines all the features from the original
version of Bourne Shell, plus additional functions to make it easier and more convenient to use.
It has since been adapted as the default shell for most systems running Linux.
Hard links point directly to the physical file on disk, and not on the pathname. This means that
if you rename or move the original file, the link will not break since the link is for the file itself,
not the path where the file is located.
Write: users may write to the file of new files to the directory
Execute: users may run the file or lookup a specific file within a directory
10. What are environmental variables?
Environmental variables are global settings that control the shell’s function as well as that of
other Linux programs. Another common term for environmental variables is global shell
variables.
Command mode – this is the mode where you start in, in this mode inserted characters are
treated as vi commands. Esc key is used to enter command mod
Edit mode or insert mode– this is the mode that allows you to do text editing. The key ”i“is
used to enter edit mode
Ex mode – This mode is also called last line mode. This mode is used to save file or quit vi
editor. Press “:” key to enter Ex mode.
cat file 1 file 2 > file 3 appends two or more files to one.
mkdir dirname
The Linux kernel is the core component of the Linux operating system. It manages hardware
resources, facilitates communication between software and hardware, and controls system
processes.
26. How do you find out your current working directory in Linux?
You can find out your current working directory in Linux using the 'pwd' (print working
directory) command.
27. What command is used to display the manual pages for other commands in Linux?
The 'man' command is used to display manual pages for other commands in Linux. For
example, 'man ls' shows the manual for the 'ls' command.
30. How can you display the last few lines of a text file in Linux?
You can display the last few lines of a text file in Linux using the 'tail' command. For example,
'tail myfile.txt' shows the last 10 lines by default.
lOMoAR cPSD| 15656105
31. How do you search for files or directories with a specific name in Linux?
You can use the 'find' command to search for files or directories with a specific name in Linux.
For example, 'find /path/to/search -name filename' searches for 'filename' in the specified path.
38. What command is used to view and manipulate the contents of text files in Linux?
The 'cat' command is commonly used to view the contents of text files in Linux.
39. What command is used to find and replace text within a file in Linux?
The 'sed' command is often used to find and replace text within a file in Linux. For example,
'sed 's/old-text/new-text/g' inputfile > outputfile' replaces all occurrences of 'oldtext' with 'new-
text' in 'inputfile' and saves the result in 'outputfile'.
40. How do you view and navigate the contents of a large text file in Linux without opening it?
You can use the 'less' command to view and navigate the contents of a large text file in Linux
without opening it entirely. Simply type 'less filename' to enter the viewer and use arrow keys
or other commands to navigate.
lOMoAR cPSD| 15656105
41. How can you copy a file from one directory to another in Linux?
You can copy a file from one directory to another in Linux using the 'cp' command. For
example, 'cp file.txt /destination/directory' copies 'file.txt' to the specified destination directory.
44. What command is used to list files and directories in a long format with additional information
like permissions and ownership?
The 'ls -l' command is used to list files and directories in a long format, providing detailed
information about permissions, ownership, file size, and more.
46. How can you use 'uniq' to count the number of occurrences of each unique line in a sorted file?
You can use 'uniq -c' to count the number of occurrences of each unique line in a sorted file.
For example, sort input.txt | uniq -c sorts 'input.txt' and counts the occurrences of each
unique line.
cd command
48. Which command is used to copy the content of one file to another?
cp
51. Which command is used to display the content of the file page by page?
lOMoAR cPSD| 15656105