GeekInterview.com
Series: Subject: Topic:

UNIX Interview Questions

Showing Questions 1 - 20 of 183 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

What difference between cmp and diff commands?

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

Cmp - compares two files byte by byte and displays the first mismatchdiff - tells the changes to be made to make the files identical

Answered by: Deepak on: Sep 3rd, 2014

To check the differences between the data of two files cmp command is used. But it displays only the first difference. Syn: $ cmp file1 file2 To display all the differences between the files diff comm...

Answered by: UncaAlby on: May 16th, 2010

diff is used primarily for files in text format, for example, source code.  It is used to list all of the differences between two files.It is often used in source code control to get the changes ...

How to find cpu utilization for only server ?

Asked By: kirankumar samudrala | Asked On: Apr 15th, 2011

Answered by: Vinil on: Aug 26th, 2014

Using "sar" command also

Answered by: kiran78 on: Jul 20th, 2012

TOP command and prstat -a

space.ksh cut -c 40-44,45-80 space.ksh > %.ksh grep "[80-10][0]%" %.ksh see the output after above cmd $ grep "[80-10][0]%" %.ksh 100% /opt/tivoli/tsm 80% /prod/users/edw 10% /prod/home01/sand I am not able to see the 81%,.......89% etc..how can i see them using grep " href="http://www.geekinterview.com/question_details/87652">How to grep directories

Asked By: hari.pardha | Asked On: Dec 21st, 2011

How to grep directories has reached above 80% from the df output using basin grep command.Below are the steps I have used df -h > date.Ksh grep "%" date.Ksh >space.Ksh cut -c 40-44,45-80 space.Ksh > %.Ksh grep "[80-10][0]%" %.Ksh see the output after above cmd $ grep "[80-10][0]%" %.Ksh 100% /opt/tivoli/tsm ...

Answered by: Vinil Mehts on: Aug 26th, 2014

You can use awk to check the % free space. Example stated as follows in UNIX.

Code
  1. df -k|
  2. awk
  3. {
  4. if $5>80;
  5.  }

Answered by: Tubal Deen on: Jun 23rd, 2014

Code
  1. df -h | awk {print $5} | sed s/.$// | egrep 8[0-9]|9[0-9]

Construct pipes to execute the following jobs?

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

1. Output of who should be displayed on the screen with value of total number of users who have logged in displayed at the bottom of the list.2. Output of ls should be displayed on the screen and from this output the lines containing the word ‘poem’ should be counted and the count should be stored in...

Answered by: praveen on: Apr 11th, 2014

1. Output of who should be displayed on the screen with value of total number of users who have logged in displayed at the bottom of the list. Ans: who | tee users.txt && who | wc -l 2. Output of ls...

Answered by: santosh on: Mar 20th, 2012

Who;echo "Total number of users: "`who|wc -l`

How to change ownership to a file or folder ?

Asked By: kirankumar samudrala | Asked On: Apr 15th, 2011

Answered by: sagar on: Apr 11th, 2014

Chmod

Answered by: Krishna sagar on: Jul 31st, 2012

Chown ownername file r directory name

How to do soft mount ?

Asked By: sendingtogaurav | Asked On: Jun 24th, 2011

Explain any precautions needs to be take before you do soft mount

Answered by: kabilan on: Mar 21st, 2014

An NFS file system that is mounted with the soft option returns an error if the server does not respond. The hard option causes the mount to continue to retry until the server responds. The default is hard

if you want to do soft mount try this cmd ln -s

Answered by: Arjun on: Feb 13th, 2013

Ln -s

Explain memory partitioning, paging, segmentation?

Asked By: Beena | Asked On: Sep 19th, 2005

Answered by: arbin pun on: Jan 31st, 2014

Segmentation eliminates internal fragmentation, but it suffers from external fragmentation. Since process is broken into a number of smaller process external fragmentation should be less. partitions...

Answered by: amit.bansal07 on: Aug 4th, 2009

Memory Partitioning- means partitioning the memory into small units or blocks & load the data or code into the blocks, & use this data & code when required by a process.Paging- i...

How to compress files in UNIX and the commands used ?

Asked By: ayypss | Asked On: Feb 7th, 2007

Answered by: Jerry Gallagher on: Jan 3rd, 2014

There are many ways to compress files in UNIX. The commands used to compress a file in UNIX are compress, zip, gzip, bzip2, and tar.
compress file_to_compress
zip .zip-filename file_to_compress
gzip file_to_compress
bzip2 file_to_compress
tar czvf file.tgz file_to_compress

Answered by: shreenidhi R on: Sep 10th, 2013

Tar -zxvf filename.tar
tar -zxvf filename.tar.gz

The root directory of disk should be placed 1. At a fixed address in main memory 2. At a fixed location on disk 3. Anywhere on the disk 4. At a fixed location on...

Asked By: Rujul | Asked On: Mar 9th, 2007

Answered by: Jerry Gallagher on: Jan 3rd, 2014

The root directory of disk also known as the MBR or the GUID partition is at a fixed location with replicas distributed at additional locations on the system disk determined by size.

Answered by: anu on: Aug 1st, 2013

Fread.This commands reads a file and stores the file in the given folder of disk.

UNIX command to store data

Asked By: ankit24_jaiswal | Asked On: Mar 17th, 2010

You have to store data on the system which command will you use(a) fread(b) fwrite(c) read(d) write

Answered by: Jerry Gallagher on: Jan 3rd, 2014

The header to this question is wrong. This is not a unix command it should be titled "C library function to store data in a file".

The answer would then be (a) fwrite.

fwrite is not operating system specific and will work the same on Unix or Windows.

Answered by: hanumant on: Jul 18th, 2013

(d) write

Boot cdrom -s

Asked By: atul | Asked On: Sep 28th, 2011

When we give boot cdrom -s which cd should be there inside cdrom ?

Answered by: Jerry Gallagher on: Jan 3rd, 2014

When issuing the boot cdrom -s the system install disk should be in the cdrom drive. Booting this way will allow you to boot in single user mode and hopefully repair a system.

Answered by: tushar on: Jan 10th, 2013

For Booting cd in CD Rom the command is :

mount cd-rom/mount

What are shell variables?

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

Shell variables are special variables, a name-value pair created and maintained by the shell. Example: path, home, mail and term

Answered by: rupesh kumar on: Dec 17th, 2013

Shell variables are special variables, a name-value pair created and maintained by the shell. Example: PATH, HOME, MAIL

Answered by: poornimay on: May 22nd, 2008

These are some more variables    .......$PWD,  $DIR_COLORS,  $SHELL,  $SHLVL

Echo command

Asked By: name is abhisek | Asked On: Nov 19th, 2012

In UNIX what is the purpose to use echo with the option "-e"?? i.E echo -e

Answered by: Manish Singh on: Dec 2nd, 2012

-e option tells echo to consider the escape sequences in the statement.

e.g. echo "Without hyphen e option
It will be the same"
Output :: Without hyphen e option
It will be the same

echo -e "With hyphen e option
It will be different"
Output :: With hyphen e option
It will be different


How can you come to the home directory?

Asked By: Bindu Puvvala | Asked On: Nov 4th, 2005

Cd $home

Answered by: pravin on: Aug 24th, 2012

These are following ways to jump to the Home directory
1. cd
2. cd ~
3. cd ~
4. cd ${HOME}

Answered by: russpark on: Sep 29th, 2010

This is a vague question, so I'll provide multiple answers.1. Home differs on various flavors of UNIX, but standard for most is: /home.  To change directory to the Home directory, you would i...

What is the output of kill -3 pid ?

Asked By: kirankumar samudrala | Asked On: Apr 15th, 2011

Answered by: kiran78 on: Jul 20th, 2012

Kill -3 pid find the thread dump jvm process

Answered by: Pranaw on: May 6th, 2012

Kill -3 pid is used to create thread dump for the process id. This is basically used for troubleshooting and to understand what went wrong with the above process. Suppose some node of weblogic is not ...

What are the parameters in http.Conf file ?

Asked By: kirankumar samudrala | Asked On: Apr 15th, 2011

Answered by: Sandhya.Kishan on: Jul 11th, 2012

Some parameters are
1.mod_rewrite
2.WLLogFile
3.DebugConfigInfo
4.StatPath
5.CookieName
6.MaxPostSize
7.FileCaching

What is vlan ?

Asked By: ashokrockz | Asked On: Feb 23rd, 2012

What is vlan in vio server in aix ? What is its main purpose ?

Answered by: Sandhya.Kishan on: Jul 11th, 2012

VLAN stands for virtual LAN,it is a broadcast domain created by switches.With VLAN’s, a switch can create the broadcast domain.The purpose of VLANS is to improve network performance by separating large broadcast domains into smaller ones.


Print using string copy and concate commands

Asked By: sweetysmarty | Asked On: Apr 19th, 2010

How will you print tata alone from tata power using string copy and concate commands in c?

Answered by: Sandhya.Kishan on: Jun 15th, 2012

Include
#include
#include

int main()
{

char myString[] = "TATA POWER";
char output[10];

strcpy(output,myString);
output[4] = ;

printf("OUTPUT :%s
", output);
printf("ORGINAL STRING :%s", myString);

getch();
}

Masked code

Asked By: sweetysmarty | Asked On: Apr 19th, 2010

What is the number of the masked code ee@?

Answered by: Sandhya.Kishan on: Jun 15th, 2012

022 is the number of the masked code ee@

If a file has permissions 000, then who can access the file?

Asked By: sviiit | Asked On: Jul 13th, 2007

Answered by: Keith G. on: May 21st, 2012

If all you want to do is get rid of that file, as I did, just save a known file, like a dummy text file, with that same name and overwrite the existing file. I replaced my errant directory file with a...

Answered by: raj2munna on: Dec 14th, 2009

When a file or directory is created the default permisions inherited .they arefor files :666for dir: 777Actually it is not the file permission .the "umask" value is subtracted from these def...

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.