Loading...

Interview Questions


What is a superblock in shell scripting?


A superblock is a program containing specific file systems' records. The characteristics available in the block are size, counts of filled and empty blocks, usage information, size of block groups, and location and size of inode tables. 

What do you understand by a shell?


Shell is a command-line interpreter that translates user-entered commands into kernel understandable language. The shell interprets the command typed in at the terminal and calls the required program

Tell about the four stages of the Linux Process


The four stages include: 

  • Waiting- The Linux process is waiting for the resource
  • Running- The Linux process is currently running
  • Stopped- The Linux process has been stopped after successful execution
  • Zombie- The Linux process is still active in the process table, but it has stopped

How can you connect to a database server?


To connect to a database server from Linux, use the isql utility that comes with the open client driver. Here is how:

isql –S serverName –U username –P password

What is the alternative command for echo?


The alternative command for echo is tput. This command allows us to control how the output is displayed on the screen

Tell us about the disadvantages of shell scripting.


Shell scripting has the following disadvantages:

  1. The process is slow initially and improves gradually
  2. Portability is not easy
  3. Typing errors can partition as well as delete entire data
  4. Weak designs can prove to be costly and can destroy the whole process

ell us about the ‘$#’ use in shell scripting.


$#' is used to display the total number of passed arguments to the script.

What is the lifespan of a shell variable?


A variable is inside the shell script only until the end of execution.

Can you separate hard and soft links in shell scripting? How?


Shell scripting is a powerful approach that uses links to create shortcuts, just like Windows. Soft links do not have any specific location and can be anywhere on the same file system, and are generally related to the file name. At the same time, hard links remain present on the same file system. Hard links are related to nodes and have a particular fixed location in most cases

Please tell us how you will check if a file exists on the filesystem.


Using the following:

if [ -f /var/log/messages ]

then

echo "File exists."

fi


Categories ( 117 )