linux Archive

Linux Interview questions – Part4

In this post, I will share next part of linux interview questions series. What is a tunnel and how you can bypass a http proxy? What is the difference between IDS and IPS? What shortcuts do you use on a regular basis? What is the Linux Standard Base? What is an atomic operation? Your freshly configured

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

Linux Interview questions – Part2

Here are the second part of Linux interview questions: What is the name and the UID of the administrator user? How to list all files, including hidden ones, in a directory? How to delete files older than 7 days from a directory?  Which command will show you free/used memory? Does free memory exist on Linux?

Linux Interview questions – Part1

I will start a series of  Linux interview questions to prepare for the interview. This is the first series and most of the answers are pretty easy to find out through the Google search. I want to share questions to prepare for interviews. For any difficult question, I will share the resources for preparation. I

Zombie vs Orphan process

When a process terminates, its resources are deallocated by the operating system. However, its entry in the process table must remain there until the parent calls wait(), because the process table contains the process’s exit status. A process that has terminated, but whose parent has not yet called wait(), is known as a zombie process. All

Temporary failure resolving – sudo apt-get update in ubuntu

If you are trying to update ubuntu respository and getting error: W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Temporary failure resolving ‘us.archive.ubuntu.com’ just check the DNS. Set the Google DNS (8.8.8.8) in /etc/resolvconf/resolv.conf.d/base [crayon-5dd0aed5902b9136043414/] then [crayon-5dd0aed5902ca988894995/] After this procedure, I was able to resolve hostnames and [crayon-5dd0aed5902d2879617714/]

Bash script to get average time from logs

What if we have logs of a server like apache or syslog server and we want to get average time from timestamps of all rows. How can we do it? Basically, we need to filter timestamp (column-8) from each row and just find its average. Below is the screenshot of the problem. (click on the