=============================================
Linux / UNIX Interview questions and answers
To display a list of all manual pages containing the keyword "date", what command would you type?
Code:
man -k date man -f date
* What command will display the first several lines of a file called "junk"?
Code:
head junk man head
* Rig it so everything in the folder gets deleted tonight at 10pm. Every night at 10pm.
Set cronjob, see How do I add jobs to cron under Linux or UNIX oses?
== Local security ==
* How do you feel about `sudo`?
sudo allows a permitted user to execute a command as the superuser or another user. sudo is much better than su and you don't have to share root password with other users/admin.
Linux sudo Configuration
* What's the difference between `telnet` and `ssh`? What's a good use for each?
TELNET, by default, does not encrypt any data sent over the connection (including password, and so it is often practical to eavesdrop on the communications and use the password later for malicious purposes;
SSH by default encrypt password and traffic. SSH is recommended for all use.
* How do you ensure your users have hard-to-guess passwords?
Set password policy, see
Howto: Protect account against a password cracking attack
Linux check passwords against a dictionary attack
Linux Password Cracking: Explain unshadow and john commands ( john the ripper tool )
== Filesystem ==
* What is the difference between a symbolic and hard link? When would you use each?
How to: Linux / UNIX create soft link with ln command
Understanding UNIX / Linux symbolic (soft) and hard links
* I have a file named `-fr`. How do I get rid of it?
Code:
rm -- -fr rm \-rf
* Why did I just ask that question?
For testing UNIX concepts and command line args.
* To partition or not? How?
Sure. See The importance of Linux partitions
* What are RAID 0, 1, 5, 0+1? What level would you use for a web server and why? A database server?
See level @ What are the different RAID levels for Linux / UNIX and Windows Server?
More about RAID - Can RAID Act As The Reliable BACKUP Solution For Linux / UNIX / Windows Server?
Linux Check The Health of Adaptec RAID array
== `/etc` ==
* `ls -l /etc`. What is all this stuff?
See, Linux / UNIX - Display the permissions of a file
* You added a line to `/etc/aliases`, but it doesn't seem to be working. Why?
Restart sendmail so that file get updated. The program "newaliases" must be run after this file is updated for any changes to show through to sendmail / postfix.
Code:
newaliases
Deny login access to zope and set shell to /sbin/nologin. There are other ways too...
* Bring up `/etc/passwd`. What is all this junk?
See, Understanding /etc/passwd file format
* What are shadow passwords?
/etc/shadow file stores actual password in encrypted format for user's account with additional properties related to user password
Understanding /etc/ shadow file
== Processes ==
* How many processes are running on your machine right now?
Code:
top atop ps -e ps aux ps aux | wc -l man ps
* Name as many shells as you can.
Bourne shell (sh)
Almquist shell (ash)
Debian Almquist shell (dash)
Bourne-Again shell (bash)
Friendly interactive shell (fish)
Korn shell (ksh)
C shell (csh)
TENEX C shell (tcsh)
Es shell (e
esh (Unix) Easy Shell
rc shell (rc) - shell for Plan 9 and Unix
runscript The initial shell interpreter used to process startup scripts in Gentoo
scsh (Scheme Shell)
Stand-alone Shell (sash)
Z shell (zsh)
* What's your favorite shell? Why?
bash - it rocks and feature rich.
* Write a shell script to append "snork" to the file "test" but only if "test" already exists.
Code:
[ -f test ] && echo "snork" >> test ||:
User will not able to login. A root user can this problem by resting permission
cmod perm /home/user
. is current directory
.. parent directory
== Startup ==
* Describe the boot process of your favorite Linux in as much detail as you can.
See redhat or any other distro doc
* What are runlevels?
The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six, though up to ten, from zero to nine, may be used.
Code:
man init man runlevel
* Describe an experience you had with a difficult user.
* How do you keep up with current tools and practices?
* How did you document your work at your last job so someone else could pick up where you left off?
Use our social skillz
== Totally miscellaneous ==
* When debugging a core in gdb, what does the command `bt` give: core memory, heap usage, or calling stack?
Code:
man gdb Read gdb page
Ask user to upgrade internet connection. If using windows ask to reboot windows .. LOL just kidding, google for slow apache problem. There could be zillions of causes
== Apache ==
* How do you rig Apache to start up on boot?
Code:
chkconfig httpd on
Code:
chkconfig httpd on httpd -t service httpd on netstat -tulpn | grep 80 tail -f /var/log/httpd/access_log tail -f /var/log/httpd/error_log
Superb.... Nice Collection.... Sir..
ReplyDeletecan u plz explain atop plz ..
ReplyDeleteuseless
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteGreat!
ReplyDeletewaist of time
ReplyDeletethis really helpfull page it resove my many problem
ReplyDeleteHi Sankar,
ReplyDeleteInteresting piece!Great to see someone write linux interview questions and answers for experienced who is not a fanatic or a complete skeptic.
I think you should have a quick look at this Unix article something that helps me all the time?
I am so grateful for your blog. Really looking forward to read more.
Obrigado,
Irene Hynes
Hello There,
ReplyDeleteI’ve often thought about this THE LINUX STUFF . Nice to have it laid out so clearly. Great eye opener.
I tilted this thread "From Windows to Linux II" because my questions are very similar to the original "From Windows to Linux." I hope this is OK. I have read those replies but I still have some questions about the best way to make the change to Windows. This is my situation:
THANK YOU!! This saved my butt today, I’m immensely grateful.
Shukran,
Radhey
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 course
Linux Online Training in kurnool
Linux Online Training in Hyderabad
Linux Online Training in Bangalore
Linux Online Training in Chennai
online training
online education
online learning
best career courses
trending courses
Linux Training in Gurgaon
ReplyDelete