Linux Interview questions – Part3

In this post, I will continue with the Linux interview questions series and share the third part of it.

  • What do the following commands do and how would you use them?
  • tee
  • awk
  • tr
  • cut
  • tac
  • curl
  • wget
  • watch
  • head
  • tail
  • What does an & after a command do? Also ? in bash script
  • What does & disown after a command do?
  • What is a packet filter and how does it work?
  • What is Virtual Memory?
  • What is swap and what is it used for?
  • What is an A record, an NS record, a PTR record, a CNAME record, an MX record?
  • Are there any other RRs and what are they used for?
  • What is a Split-Horizon DNS?
  • What is the sticky bit?
  • What does the immutable bit do to a file?
  • What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink?
  • What is an inode and what fields are stored in an inode?
  • How to force/trigger a file system check on next reboot?
  • What is SNMP and what is it used for?
  • What is a runlevel and how to get the current runlevel?
  • What is SSH port forwarding?
  • What is the difference between local and remote port forwarding?
  • What are the steps to add a user to a system without using useradd/adduser?
  • What is MAJOR and MINOR numbers of special files?
  • Describe the mknod command and when you’d use it.
  • Describe a scenario when you get a “filesystem is full” error, but ‘df’ shows there is free space.
  • Describe a scenario when deleting a file, but ‘df’ not showing the space being freed.
  • Describe how ‘ps’ works.
  • What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
  • Explain briefly each one of the process states.
  • How to know which process listens on a specific port?
  • What is a zombie process and what could be the cause of it?
  • You run a bash script and you want to see its output on your terminal and save it to a file at the same time. How could you do it?
  • Explain what echo “1” > /proc/sys/net/ipv4/ip_forward does.
  • Describe briefly the steps you need to take in order to create and install a valid certificate for the site https://foo.example.com.
  • Can you have several HTTPS virtual hosts sharing the same IP?
  • What is a wildcard certificate?
  • Which Linux file types do you know?
  • What is the difference between a process and a thread? And parent and child processes after a fork system call?
  • What is the difference between exec and fork?
  • What is “nohup” used for?
  • What is the difference between these two commands?
  • myvar=hello
  • export myvar=hello
  • How many NTP servers would you configure in your local ntp.conf?
  • What does the column ‘reach’ mean in ntpq -p output?
  • You need to upgrade kernel at 100-1000 servers, how you would do this?
  • How can you get Host, Channel, ID, LUN of SCSI disk?
  • How can you limit process memory usage?
  • What is bash quick substitution/caret replace(^x^y)?
  • Do you know of any alternative shells? If so, have you used any?
  • What is a tarpipe (or, how would you go about copying everything, including hardlinks and special files, from one server to another)?
  • How can you tell if the httpd package was already installed? rpm -qa | grep <package name>
  • How can you list the contents of a package?
  • How can you determine which package is better: openssh-server-5.3p1-118.1.el6_8.x86_64 or openssh-server-6.6p1-1.el6.x86_64 ?
  • Difference b/w soft link vs hard links?
  • Difference b/w ~/.bash and ~/.profile files?