To a little surprise this time we are not presenting Interview question on any specific subject but on random topics. These question will surely help you in cracking Interviews beside adding to your Knowledge.

1. Let’s say you maintains a backup on regular basis for the company you are working. The backups are maintained in Compressed file format. You need to examine a log, two months old. What would you suggest without decompressing the compressed file?
# zcat f phpshell2.4.tar.gz
2. You need to track events on your system. What will you do?
Running ‘syslogd‘ application in terminal generates log file at the location ‘/var/log/syslog‘. The syslogd application is very useful in troubleshooting Linux sytems. A sample log file looks similar to below.

3. How will you restrict IP so that the restricted IP’s may not use the FTP Server?
Block IP Address
Open ‘/etc/hosts.deny’ file.
# vi /etc/hosts.deny
Add the IP address that you want to block at the bottom of the file.
# # hosts.deny This file contains access rules which are used to # deny connections to network services that either use # the tcp_wrappers library or that have been # started through a tcp_wrappers-enabled xinetd. # # The rules in this file can also be set up in # /etc/hosts.allow with a 'deny' option instead. # # See 'man 5 hosts_options' and 'man 5 hosts_access' # for information on rule syntax. # See 'man tcpd' for information on tcp_wrappers # vsftpd:172.16.16.1
4. Tell us the difference between Telnet and SSH?
6. You need to stop your X server. When you tries to kill your X server, You got an error message that you cannot quit X server. What will you do?
6. What is the difference between command ‘ping’ and ‘ping6’?
7. You want to search for all the *.tar files in your Home directory and wants to delete all at once. How will you do it?
# find /home/ name '*.tar' | xargs rm rf
8. What is the difference between locate and slocate command?
9. You need to search for the string “Tecmint” in all the “.txt” files in the current directory. How will you do it?
# find -name “*.txt” | xargs grep “Tecmint”
10. You want to send a message to all connected users as “Server is going down for maintenance”, what will you do?
# echo please save your work, immediately. The server is going down for Maintenance at 12:30 Pm, sharply. | wall

That’s all for now. I will be here again, with an interesting article very soon. Till then stay tuned and connected to Tecmint. Don’t Forget to give your valuable feedback in comment section below.
Very very useful Thank You
On question #9, why not do:
grep Tecmint *
There are many ways to perform that operation in the current directory. However, not including subdirectories, one can type much less by using the above command…
@Lee,
The
grep Tecmint *
, do you think this command will list string “Tecmint“? have you tried it before suggesting, i suggest you to try yourself and see long it takes and what it does before giving final results, for me this command is just a waste of time….and will not work at all..Answer : To check the contents of a compressed file without the need of decompressing it, we need to use ‘zcat’. The zcat utility makes it possible to view the contents of a compressed file.
This answer implies that zcat doesn’t decompress the file, and uses some fancy algorithm to read compressed data.
This is not the case, it decompresses the file anyway, then cats the decompressed data.
Very Useful ..Thank You :)
Thanku very much can you send more questions to me please
CTRL-ALT-BKSpace is disabled in most of the “desktop” linux distro’s. Best to kill it from CLI.
Very useful questions…..Thank you
Several comments:
7: find /home/ -name \*.tar -exec rm {} \;
– -exec says whenever you find a match, run the command substituting {} with the filename
– Escape characters that may be interpreted by the shell, like * and ;
– no need for -rf since these are files and not directories
The best method is: find /home -name \*.tar -delete
Hi Avishek,
your articles help a lot for linux beginners. But I was stuck with few questions.
I need to list the files from remote ftp server with regular expression as RCCCFHW01N[0-9]{4}2014[0-9]{10}.dat..
can you help me in listing the files particular 2014 in which remote server holds files from different years.
This is so baloney. Where is the Linux Bible ebook that I can download?
@Amalayar,
Here is the download link to the Linux Bible ebook.
http://tecmint.tradepub.com/free/w_wile13/prgm.cgi