EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

UNIX Interview Questions

By Priya PedamkarPriya Pedamkar

Home » Software Development » Software Development Tutorials » Unix Tutorial » UNIX Interview Questions

UNIX interview questions

Introduction to UNIX Interview Questions and Answers

UNIX is basically one secure operating system which most popular in the banking sector or especially those organization who are preferring secure system. It actually replacing Windows operating system mainly for server location or environment.

All in One Software Development Bundle (600+ Courses, 50+ projects)
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (78,077 ratings)
View Course

UNIX interviewer is mainly asking or concentrating on UNIX commands which are very much well known and common command for all. The person who will attain the interview has to be stronger in the UNIX command or shell script.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Common UNIX Command

Common UNIX command is explained below:

ls —> all the available files display by executing the same.

ls -l —>  mainly use to lists the files in long format, it contains more information like size of the file, owners detail, and rights or permission for other user and provided last modified data.

ls -a —>  Mainly using to display those files which are starting with dot.

more filename —> displaying some part of file how much it can adjust in one screen. Hitting on space bar will display more data from that file, q can be used for quit. For searching the text inside the file searching text can be put after /.

mv filename1 filename2 —> just move the file or cut the file. Normally used to move one file from one directory to another.

Popular Course in this category
Linux Training Program (16 Courses, 3+ Projects)
  16 Online Courses |  3 Hands-on Projects|  160+ Hours|  Verifiable Certificate of Completion
4.5
Course Price

View Course

Kali Linux Training (3 Courses, 3+ Projects)

4.9

Red Hat Linux Training Program (4 Courses, 1+ Projects)

4.8


cp filename1 filename2 —> Copy the file with content in the same location.

rm filename —> using to remove the file from the directory. There has one option to use rm –I, which provide one confirmation text to the user before delete, possible to make this behavior as default for any deleting activity by adding one alias in a .cshrc file.

diff filename1 filename2 —> Using for compare both the file and give the result with different.

wc filename —> Given details of a number of lines, words or characters in a file.

chmod options filename —> Mainly using for providing permission on specific script or file. Default permission to the creator for reading and edit. But anyone needs that specific file to be read, write and executable then chmod command need to be used. We mainly user 3 number at the time of executing chmod.

Chmod 754

First Number 7 = Provide access read, write and execute for the user.

Second Number 5 = Provide access read and execute for the group.

Third Number 4 = Provide access one read for other

N Description ls binary
0 No permissions at all — 000
1 Only execute –x 001
2 Only write -w- 010
3 Write and execute -wx 011
4 Only read r– 100
5 Read and execute r-x 101
6 Read and write rw- 110
7 Read, write, and execute rwx 111

gzip filename —> compressing multiple files, similar to ZIP file concept of windows.

gunzip filename —> mainly to uncompress zip file which is compressed by gzip.

lpr filename —> mainly used for print, want to specify different printer name rather than default printer than –P option can be used.

mkdir dirname —> command to create the new directory in command executable location. Duplicate directory name will not be allowed, and all the names are case sensitive.

cd dirname —> Mainly using for changing the directory, it will help to move in another directory and find all the file name in the new directory (ls –lrt command will help to display all the files under this directory). Move back to the previous directory normally use cd .., and move back to multiple parent directory normally execute cd .. / .. / .., which help to move directly in 3 top directories by executing one command. Cd directory name is also very much use in windows command script. Normally when one user logged in UNIX box he moves to a home directory, then they have to use the cd command to move in proper directory to execute any other require command.

pwd —> Always presenting the current location of the user.

Preparing for a job interview in UNIX. I am sure you want to know the most common UNIX Interview Questions that will help you crack the UNIX Interview with ease. Below is the list of top UNIX Interview Questions and answers at your rescue.

Part 1 – UNIX Interview Questions and Answers (Basic)

This first part covers basic UNIX interview questions and answers

1. Command to find out those files which are hidden in the current directory

Answer:
$ ls -lrta

2. Command to find out existing active running process currently in the UNIX system?

Answer:
$ ps -ef

Now if we know the name of the process we can add grep after ps –ef like below:

$ ps –ef | grep java

Let us move to the next UNIX interview questions

3. How one can determine memory utilization by an entire process in UNIX box?

Answer:
This is the basic UNIX interview questions that are asked in an interview.
By using the $ top command.

top command provides all the details including memory usage, process ID, and others. Commands display should be like below:Command display

4. Explain command to find out Exception in application log file, suppose log file name is server.log?

Answer:
$ grep ‘Exception’ server.log —> will give the expected result.

$ grep ‘Exception’ server.log | wc –l —> will give the proper count of exception in total application server log file.

5. Command to find all the files exist in the same directory or subdirectory which contains a name like ‘Java’?

Answer:
$ find. -name ‘Java’

Part 2 – UNIX interview questions and answers (Advanced)

This first part covers Advanced UNIX interview questions and answers

6. How is Shell script accepting command line arguments for internal processing in shell script logic?

Answer:
Arguments pass from the command line can be easily accepted in the shell script by using $ (dollar sign). It always followed argument numeric position on a command line.

7. Display or present last 200 lines of an existing file in UNIX box.

Answer:
$ tail -200f newfile.txt

Let us move to the next UNIX interview questions

8. Command to find out remaining disk space in UNIX/Linux server.

Answer:
$ df –kl

[db2inst1@eproc-db1-eps-temp ~]$ df -kl

Filesystem           1K-blocks    Used Available Use% Mounted on

/dev/mapper/vg0-root  41153856 6322928  32733776  17% /

tmpfs                  4029268     100   4029168   1% /dev/shm

/dev/sda1               487652   33803    428249   8% /boot

/dev/mapper/vg0-database1

20511356 6900920  12561988  36% /database1

/dev/mapper/vg0-database2

10190136 4346232   5319616  45% /database2

/dev/mapper/vg0-database3

10190136 7615792   2050056  79% /database3

/dev/mapper/vg0-backup

5029504 3549988   1217372  75% /backup

disk space

9. Provide access to any script file for executable.

Answer:
$ chmod 755 *.sh

This is the advanced UNIX interview questions that are asked in an interview. If the requirement is to script should be readable, writable and executable for any user, then the command can be chmod 777 *.sh

10. How can we able to kill one process in UNIX box?

Answer:
$ kill -9 #pid —> pid can be found by executing ps –ef command.

Recommended Articles

This has been a guide to List Of UNIX Interview Questions. Here we have listed the most useful 10 interview sets of questions so that the jobseeker can crack the interview with ease. You may also look at the following articles to learn more –

  1. 4 Useful Of  Shell Script Types For Linux Newbies (Helpful)
  2. Advanced SQL Interview Questions And Answers
  3. Useful Windows Server Interview Questions
  4. Ab initio Interview Questions And Answers
  5. java web services Interview Questions and Answers

Linux Training Program (16 Courses, 3+ Projects)

16 Online Courses

3 Hands-on Projects

160+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More


8 Shares
Share
Tweet
Share
Primary Sidebar
Unix Tutorial
  • Advanced
    • Array in Unix
    • Functions in Unix
    • Unix File Permissions
    • Unix File System
    • Unix Shell Commands
    • Crontab in Unix
    • egrep command in Unix
    • For Loop in Unix
    • VI Editor in Unix
    • What is Unix Shell
    • Gnome Development
    • UNIX interview questions
    • Cheat sheet for UNIX
    • Unix Sort by Column
    • Find Command in Unix
    • Gnome Version
  • Basic
    • What is Unix
    • Uses of Unix
    • Career In Unix
    • Install UNIX
    • Unix Architecture
    • Unix Commands
    • VI Command in Unix
    • AWK Command in Unix
    • Paste Command in Unix
    • SED Command in Unix
    • Sort Command in Unix
    • WHO Command in Unix
    • Unix Operators
    • UNIX Administrator

Related Courses

Linux Training Course

Kali Linux Training

Red Hat Training Course

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

Special Offer - Linux Training Program (16 Courses, 3+ Projects) Learn More