Category: Linux

The Whole File:- Linux Interview Questions and Answers

You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?
tail -15 dog cat horse

The tail utility displays the end of a file. The -15 tells tail to display the last fifteen lines of each specified file.

Who owns the data dictionary?
The SYS user owns the data dictionary. The SYS and SYSTEM users are created when the database is created.

You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility.

The zcat utility allows you to examine the contents of a compressed file much the same way that cat displays a file.

You suspect that you have two commands with the same name as the command is not producing the expected results. What command can you use to determine the location of the command being run?

The which command searches your path until it finds a command that matches the command you are looking for and displays its full path.

You locate a command in the /bin directory but do not know what it does. What command can you use to determine its purpose.

The whatis command displays a summary line from the man page for the specified command.

You wish to create a link to the /data directory in bob’s home directory so you issue the command ln /data /home/bob/datalink but the command fails. What option should you use in this command line to be successful.
Use the -F option

In order to create a link to a directory you must use the -F option.

When you issue the command ls -l, the first character of the resulting display represents the file’s ___________.

The first character of the permission block designates the type of file that is being displayed.

What utility can you use to show a dynamic listing of running processes? __________

The top utility shows a listing of all running processes that is dynamically updated.

Where is standard output usually directed?
to the screen or display

By default, your shell directs standard output to your screen or display.

You wish to restore the file memo.ben which was backed up in the tarfile MyBackup.tar. What command should you type?
tar xf MyBackup.tar memo.ben

This command uses the x switch to extract a file. Here the file memo.ben will be restored from the tarfile MyBackup.tar.

You need to view the contents of the tarfile called MyBackup.tar. What command would you use?
tar tf MyBackup.tar

The t switch tells tar to display the contents and the f modifier specifies which file to examine.

You want to create a compressed backup of the users’ home directories. What utility should you use?

You can use the z modifier with tar to compress your archive at the same time as creating it.

What daemon is responsible for tracking events on your system?

The syslogd daemon is responsible for tracking system information and saving it to specified log files.

****many more****

UNIX File Management Interview Questions and Answers

UNIX Memory Management Interview Questions and Answers

UNIX Process Management Interview Questions and Answers

A. If you want to install using apt-get.

Step 1: make sure that you are connected with internet, then open the command prompt and follow the steps
Step 2: type the following command and press enter run
$ sudo apt-get update (to update the repository)
$ sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin sun-java6-fonts
Step 3: installation will immediately start, Follow the steps, you can move using TAB key for selecting the options.
Step 4: Now set JAVA_HOME and PATH params in .bashrc file.
first locate the jdk installation directory using locate command, generally jdk is installed at /usr/lib/jvm.
you can find a shoft link java-6-sun within /usr/lib/jvm pointing to jdk directory.
open ~/.bashrc by following command in gedit
$gedit ~/.bashrc
in the .bashrc file scroll down after the last line written and then type the following
export JAVA_HOME=/usr/lib/jvm/java-6-sun   #this sets the JAVA_HOME parameter for the environment
and will be used by other applications to find JAVA in your system (such as apache tomcat for example)
export PATH=$PATH:$JAVA_HOME/bin   #this will append java bin path to your existing path parameter
Step 5: you are done, exit terminal, reopen terminal, type a java program and compile with javac and run with java.

B . If you want install jdk from a downloaded bin file

Step: 1  ->   download sun java JDK bin file “jdk-6u18-linux-i586.bin” or the latest version from
Step: 2  ->   create a directory under your Home/USER directory with name jvm , For  Example My
user directory is /home/saikat and I have created a directory jvm under /home/saikat that is jvm is
under ~ (~ symbol in linux indicates the user home directory, that is ~ is equivalent of saying /home/saikat in my

Step: 3  -> copy jdk-6u18-linux-i586.bin to ~/jvm directory.
Step: 4  -> open the terminal, in gnome one can find the terminal link at Application ->Accessories -> Terminal.
Step: 5  -> go inside ~/jvm by using cd command.
that is from $ prompt type:  cd ~/jvm
.bin files are self extractor executable, they need to be executed with ./ command.
So in order to start the installation process type the followinf command from the $ prompt (from within ~/jvm directory)
./jdk-6u18-linux-i586.bin     (if you have different version bin file then write your .bin file name)

Immediately installation proceedure will start, scroll down till u find “More” written at the bottom and until u get the
following message

Please enter “yes” or “no”.
Do you agree to the above license terms? [yes or no]
type “yes” and press enter and then extraction will start immediately and it will complete the extraction and installation
Step 6:   -> After the above process you can find a directory named jdk1.6.0_18 under ~/jvm, all the required JDK files are inflated
under jdk1.6.0_18.
Step 7:   -> Now create a soft link of jdk1.6.0_18 directory by the following command
$ln -s jdk1.6.0_18 java-6-sun  (java-6-sun is the name of your softlink (in windows terminology a softlink is just
equivalent of a short-cut) )
Step 8:   -> Now set the PATH parameter of your environment.
for that type the following from your $ prompt.
$ gedit   ~/.bashrc
(gedit is a text based editor for gnome, you can edit text files in gedit, windows equivalent of gedit is wordpad.)
you will find gedit window appearing with .bashrc file, this is your profile file.
scroll down to the end of the file and append the following line:
export JAVA_HOME=~/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin

please dont do anyother thing in .bashrc (unless u understand what u r doing).
click save and exit from gedit.
Step 9: exit from terminal typing exit. Reopen terminal and write a java program and compile with javac and run with java. You are

Ultimate guide to LINUX – From installation to every thing…

Download the following pdf:- LINUX Tutorial


*** the file was created by my teacher Mr. Shibaji Paul and one of his student ***

Unix Tutorial

Unix Tutorial

Tutorial File :- Unix

Unix – Home

  • Unix – Getting Started
  • Unix – File Management
  • Unix – Directories
  • Unix – File Permission
  • Unix – Environment
  • Unix – Basic Utilities
  • Unix – Pipes & Filters
  • Unix – Processes
  • Unix – Communication
  • Unix – The vi Editor

Unix Shell Programming

  • Unix – What is Shell?
  • Unix – Using Variables
  • Unix – Special Variables
  • Unix – Using Arrays
  • Unix – Basic Operators
  • Unix – Decision Making
  • Unix – Shell Loops
  • Unix – Loop Control
  • Unix – Shell Substitutions
  • Unix – Quoting Mechanisms
  • Unix – IO Redirections
  • Unix – Shell Functions
  • Unix – Manpage Help

Advanced Unix

  • Unix – Regular Expressions
  • Unix – File System Basics
  • Unix – User Administration
  • Unix – System Performance
  • Unix – System Logging
  • Unix – Signals and Traps

Unix Useful Resources

  • Unix – Useful Commands
  • Unix – Quick Guide
  • Unix – Builtin Functions
  • Unix – System Calls
  • Unix – Commands List
  • Unix Useful Resources