In most of banks, the unix or linux is prefered application hosting platform, compare to the windows. It is always added advantage for candidate to be familiar with unix commands. These are basic unix commands which are sometime asked to candidate for checking his\her unix skills. These questions are mainly related to log search, find commands and unix processes. These commands are very handy if we are investigating any issue in production\uat. As application developer we must have came across these unix commands. Mostly questions are not asked in depth and they just confirm your familiarity with unix commands. These are most frequently asked unix commands in interview.
1) How to find hidden files in current directory?
$ ls -lrta
2) How to find current running processes in unix server?
$ ps -ef
and if we want to find specific process we can use 'grep' with pipe
$ ps -ef | grep -i 'application'
3) How to find process which is taking maximum memory in server?
$ top
top command tell us about cpu usage , process id and other details. below is output of top command
4) How to find Exception in log files available in current directory and how to find number of occurrence?
$ grep 'Exception' log1.txt | wc -l
5) find all files in current and subdirectories which contains 'log' name?
$ find . -name 'log'
6) How do you access command line arguments from within a shell script?
7) How to tails last 200 lines of any log fine?
$ tail -200f filename.txt
1) How to find hidden files in current directory?
$ ls -lrta
2) How to find current running processes in unix server?
$ ps -ef
and if we want to find specific process we can use 'grep' with pipe
$ ps -ef | grep -i 'application'
3) How to find process which is taking maximum memory in server?
$ top
top command tell us about cpu usage , process id and other details. below is output of top command
4) How to find Exception in log files available in current directory and how to find number of occurrence?
$ grep 'Exception' log1.txt | wc -l
5) find all files in current and subdirectories which contains 'log' name?
$ find . -name 'log'
6) How do you access command line arguments from within a shell script?
Arguments passed from the command line to a shell script can be accessed within the shell script by using a $ (dollar sign) immediately followed with the argument's numeric position on the command line.
7) How to tails last 200 lines of any log fine?
$ tail -200f filename.txt
8) How to find remaining disk space in unix\linux server?
$ df -kl
df -kl
Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk0s2 244277768 153679844 90341924 63% 38483959 22585481 63% /
9) How to make any script file executable?
$chmod 755 *.sh
10) How to kill process in unix server?
$ kill -9 #pid
these #pid can be found using ps -ef command.
BASIC Unix Command List
10) How to kill process in unix server?
$ kill -9 #pid
these #pid can be found using ps -ef command.
BASIC Unix Command List
- ls --- lists your files
ls -l --- lists your files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified.
ls -a --- lists all files, including the ones whose filenames begin in a dot, which you do not always want to see.
There are many more options, for example to list files by size, by date, recursively etc. - more filename --- shows the first part of a file, just as much as will fit on one screen. Just hit the space bar to see more or q to quit. You can use /pattern to search for a pattern.
- mv filename1 filename2 --- moves a file (i.e. gives it a different name, or moves it into a different directory (see below)
- cp filename1 filename2 --- copies a file
- rm filename --- removes a file. It is wise to use the option rm -i, which will ask you for confirmation before actually deleting anything. You can make this your default by making an alias in your .cshrc file.
- diff filename1 filename2 --- compares files, and shows where they differ
- wc filename --- tells you how many lines, words, and characters there are in a file
- chmod options filename --- lets you change the read, write, and execute permissions on your files. The default is that only you can look at them and change them, but you may sometimes want to change these permissions. For example, chmod o+r filename will make the file readable for everyone, and chmod o-r filename will make it unreadable for others again. Note that for someone to be able to actually look at the file the directories it is in need to be at least executable.
- File Compression
- gzip filename --- compresses files, so that they take up much less space. Usually text files compress to about half their original size, but it depends very much on the size of the file and the nature of the contents. There are other tools for this purpose, too (e.g. compress), but gzip usually gives the highest compression rate. Gzip produces files with the ending '.gz' appended to the original filename.
- gunzip filename --- uncompresses files compressed by gzip.
- gzcat filename --- lets you look at a gzipped file without actually having to gunzip it (same as gunzip -c). You can even print it directly, using gzcat filename | lpr
- printing
- lpr filename --- print. Use the -P option to specify the printer name if you want to use a printer other than your default printer. For example, if you want to print double-sided, use 'lpr -Pvalkyr-d', or if you're at CSLI, you may want to use 'lpr -Pcord115-d'. See 'help printers' for more information about printers and their locations.
Directories
Directories, like folders on a Macintosh, are used to group files together in a hierarchical structure.- mkdir dirname --- make a new directory
- cd dirname --- change directory. You basically 'go' to another directory, and you will see the files in that directory when you do 'ls'. You always start out in your 'home directory', and you can get back there by typing 'cd' without arguments. 'cd ..' will get you one level up from your current position. You don't have to walk along step by step - you can make big leaps or avoid walking around by specifying pathnames.
- pwd --- tells you where you currently are.
Nice questions..This might be useful questions to you ...164 Core Java Interview Questions.
ReplyDeleteExcellent all questions are very use full and important one Thank you.
ReplyDeleteThank you for this Information !!
ReplyDeleteLINUX INTERVIEW QUESTIONS
Linux FTP vsftpd Interview Questions
SSH Interview Questions
Apache Interview Questions
Nagios Interview questions
IPTABLES Interview Questions
Ldap Server Interview Questions
LVM Interview questions
Sendmail Server Interview Questions
Read more at Linux Troubleshooting
Nice posts.
ReplyDeleteSarkari Result
Latest Govt Bank Jobs Recruitment Notification 2016
ReplyDeleteThanks for writing such a good article, I stumbled onto your website and read a few articles. I like your way of writing......................
Most important command for developers. Every Developers must know these command
ReplyDeletehttp://www.javaproficiency.com/2015/04/basic-unix-commands-for-java-developers.html
nice one
ReplyDeleteHi Nice Blog
ReplyDeleteBefore facing job interview we should prepare for it and best thing is that we should know type of question and frequently asked questions and after doing such small thing we can grab that job.
Your website is wonderful, let alone the content material
ReplyDeleteinterview preparation online
Thanks for sharing this great Post....!
ReplyDeleteJava Development Company in India
useful blog
ReplyDeletebest java j2ee training | java training center in chennai | java training institute in chennai | java j2ee training center in chennai
This information is stunning. I really inspired with your post writing style & how continuously you describe this topic. After reading your post, I feel very happy about it and I love learning more about this topic. Please keep update like this excellent post.
ReplyDeleteEngineering Colleges, ECE Engineering Colleges in Chennai
This comment has been removed by the author.
ReplyDeleteHelpful article.. This article really useful to cracking the unix interviews easily.. thank you for sharing
ReplyDeletehadoop training institute in chennai | big data training institute in chennai
Very Helpful article for Java Learners.Nice.Keep it up.
ReplyDeleteInterior Designers in Chennai
Interiors in Chennai
Good Interior Designers in Chennai
Very useful blog for java and Linux learners and this blog is used crack the interviews easily...
ReplyDeleteInterior Designers in Chennai
Interior Decorators in Chennai
Interior Design in Chennai
Really something Grate in this article Thanks for sharing this. We are providing Online Training Classes. After reading this slightly I am changed my way of introduction about my training to people.
ReplyDeleteBest Linux training in Noida
Linux Training Institute in Noida
Shell Scripting Training Institute in Noida
Really something Grate in this article Thanks for sharing this. We are providing Online Training Classes. After reading this slightly I am changed my way of introduction about my training to people.
ReplyDeleteBest Linux training in Noida
Linux Training Institute in Noida
Shell Scripting Training Institute in Noida
Nice Blog, Thanks for Sharing this blog
ReplyDeleteUnix Institute in Gurgaon
Hello Buddy,
ReplyDeleteI am shocked, that there is such article exist!! But I really think you did a great job highlighting some of the key Unix commands : Top 10 frequently asked interview questions in the entire space.
Though the names and filesystem locations of the Unix components have changed substantially across the history of the system.
Very useful article, if I run into challenges along the way, I will share them here.
Obrigado,
Ajeeth Kapoor
ReplyDeleteHi Your Blog is very nice!!
Get All Top Interview Questions and answers PHP, Magento, laravel,Java, Dot Net, Database, Sql, Mysql, Oracle, Angularjs, Vue Js, Express js, React Js,
Hadoop, Apache spark, Apache Scala, Tensorflow.
Mysql Interview Questions for Experienced
php interview questions for freshers
php interview questions for experienced
python interview questions for freshers
tally interview questions and answers
codeingniter interview questions
cakephp interview questions
express Js interview questions
react js interview questions
laravel Interview questions and answers
Nice and good article.I have suggested to my friends to go through this blog. Thanks for sharing this useful information. If you want to learn Linux course in online, please visit below site.
ReplyDeleteLinux Online Training
linux online course
Linux Online Training in Hyderabad
Linux Online Training in Bangalore
Linux Online Training in Chennai
This comment has been removed by the author.
ReplyDeleteNice blog. Very informative. Thanks for sharing. Keep updating.
ReplyDeleteLinux Online Training
linux online course
Linux Online Training in Hyderabad
Linux Online Training in Bangalore
Thanks for posting this useful information, Keep sharing more posts like this.
ReplyDeleteDevOps Online Training
Awesome post with lots of data and I have bookmarked this page for my reference. Share more ideas frequently.
ReplyDeleteBlue Prism Training in Chennai
Blue Prism Training Institute in Chennai
UiPath Training in Chennai
Robotics Process Automation Training in Chennai
RPA Training in Chennai
Data Science Course in Chennai
Blue Prism Training in OMR
Blue Prism Training in Porur
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
ReplyDeletewebsite: geeksforgeeks.org
A Computer Science portal for geeks. It contains well written, well thought and well
ReplyDeleteexplained computer science and programming articles, quizzes and practice/competitive
programming/company interview Questions.
website: geeksforgeeks.org
A Computer Science portal for geeks. It contains well written, well thought and well
ReplyDeleteexplained computer science and programming articles, quizzes and practice/competitive
programming/company interview Questions.
website: geeksforgeeks.org
A Computer Science portal for geeks. It contains well written, well thought and well
ReplyDeleteexplained computer science and programming articles, quizzes and practice/competitive
programming/company interview Questions.
website: geeksforgeeks.org
Actually i found this blog and that is amazing thing I enjoy reading this easy to understand stuff. Keep it up.
ReplyDeleteInterior Designers In Chennai
<a
This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
ReplyDeleteOffice interior designers in chennai
living room interior designers in chennai
False ceiling interiors designers in chennai
Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us
ReplyDeletebest digital marketing company
digital marketing agency in chennai
digital marketing services
website design company
It is for the first that I just visited your site and I find it really interesting! Congratulations! please visit for latesetnews
ReplyDeleteI really enjoyed your blog Thanks for sharing such an informative post.
ReplyDeleteMahaveer Interior Company by Mahaveer Interior Brings Affordable and Modern Interior Designing Solutions in Jajpur Get Expert Advice for Living Rooms, Bathroom and Kitchen.
https://mahaveerinterior.com/
Very informative and useful.
ReplyDeleteJava training in Nagpur
informative blog, keep posting java course in satara
ReplyDelete