Krishna Logo
qa training in canada now
Divied
Call: Anusha @ 1 (877) 864-8462

 

Latest News
Home Navigation Divied
INTERVIEW Navigation Divied UNIX INTERVIEW QUESTIONS
Showing 61 - 70 of 324 Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next
UNIX INTERVIEW QUESTIONS
 
61What Is A Shell
Date Posted: 07/02/2012

Ans: A shell is an interactive user interface to an operating system service that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them to system calls to the OS or forks off a process to execute the command. System call results and other information from the OS are presented to the user through an interactive interface. Commonly used shells are sh, csh, ks etc.

 
 
62How Does The Inode Map To Data Block Of A File
Date Posted: 07/02/2012

Ans: Inode has 13 block addresses. The first 10 are direct block addresses of the first 10 data blocks in the file. The 11th address points to a one-level index block. The 12th address points to a two-level (double in-direction) index block. The 13th address points to a three-level(triple in-direction)index block. This provides a very large maximum file size with efficient access to large files, but also small files are accessed directly in one disk read.

 
 
63How To Get The CPU And Memory Details In Linux Server?
Date Posted: 07/02/2012

Ans: In Linux based systems, you can easily access the CPU and memory details from the /proc/cpuinfo and /proc/meminfo, like this:
$>cat /proc/meminfo
$>cat /proc/cpuinfo
Just try the above commands in your system to see how it works

 
 
64How To Tell If My Process Is Running In Unix?
Date Posted: 07/02/2012

Ans: You can list down all the running processes using [ps] command. Then you can “grep” your user name or process name to see if the process is running. See below:
$>ps -e -o stime,user,pid,args,%mem,%cpu | grep "opera"
14:53 opera 29904 sleep 60                     0.0  0.0
14:54 opera 31536 ps -e -o stime,user,pid,arg  0.0  0.0
14:54 opera 31538 grep opera                   0.0  0.0

 
 

Ans: The standard command to see this is [ps]. But [ps] only shows you the snapshot of the processes at that instance. If you need to monitor the processes for a certain period of time and need to refresh the results in each interval, consider usi...  

 
 
66How To Check If A File Is Present In A Particular Directory In UNIX?
Date Posted: 07/02/2012

Ans: Using command, we can do it in many ways. Based on what we have learnt so far, we can make use of [ls] and [$?] command to do this. See below:
$> ls –l file.txt; echo $?

If the file exists, the [ls] command will be successful. Hence [echo $?] will print 0. If the file does not exist, then [ls] command will fail and hence [echo $?] will print 1.

 
 
67How To Check If The Last Command Was Successful In UNIX?
Date Posted: 07/02/2012

Ans: To check the status of last executed command in UNIX, you can check the value of an inbuilt bash variable [$?]. See the below example:
$> echo $?

 
 
68How To List Down File/folder Lists Alphabetically?
Date Posted: 07/02/2012

Ans: Normally [ls –lt] command lists down file/folder list sorted by modified time. If you want to list then alphabetically, then you should simply specify: [ls –l]

 
 
69How To Fail A Shell Script Programmatically?
Date Posted: 07/02/2012

  Ans: Just put an [exit] command in the shell script with return value other than 0. this is because the exit codes of successful Unix programs is zero. So, suppose if you write
Exit -1
Inside your program, then your program will thrown an error and exit immediately.

 
 
70How To Check The Command Line Arguments In A UNIX Command In Shell Script?
Date Posted: 07/02/2012

  Ans: In a bash shell, you can access the command line arguments using $0, $1, $2, variables, where $0 prints the command name, $1 prints the first input parameter of the command, $2 the second input parameter of the command and so on.

 
Showing 61 - 70 of 324 Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next
Shadow Bottom
 
 
© 2005 -