Top Linux Interview Questions

So you want to ace that interview for a Linux position in a company and want to know what would be the interview questions you really need to know?

Let’s get into it. We’ll start with a few harder ones and ease you into the easy ones 😉

How do you check for free disk space?

df -ah


df is your friend. In an interview you will be expected to talk a little about how these files are taking up space in the file system and what they are for, so do some extra research into those.

How can you see the kernel version of the machine?

uname -a


You can also use the -v flag for just the version or -r for the release.

How do you start a service on a Linux System?

You will need to use the service command followed by the service you want to start, for instance, to start up Apache2 server.

service apache2 start


You can also use status to see the status of the service or stop to kill the process.

How do you check the IP of a Linux system?



You can get a lot more details if you specify the interface you want, for instance if you wanted to only see interface eth0.

ifconfig eth0

How do you check for open ports on Linux?



You can refine the search to only display UDP connections.

netstat -tulpn

What command would you use to print the working directory?

This one comes up a lot to try to catch you out, but the answer is in the question.

[P]rint  [W]orking  [D]irectory.



Let’s say you have an Apache web server running on Linux, where would you find the server’s index.html file?

Easy, but good to know.

cd /var/www/html


How, as a root user, do you give full permissions to a file to read, write and execute.

Let’s create a file called for this example.

sudo nano

print("hello world!")



So we have the file called that we just created.9

We can see it in white. This means it has not been given permissions to all users. So let’s change that.

sudo chmod 777


Now we can see the file is green and ready to execute. You could also give it the same permissions using the following command.

sudo chmod -x

How do you see all of the running processes on Linux?

Most people will use ps.


But if you are a real Linux pro the following command is what will set you apart from other candidates. And it’s an easy one.



I really hope this helps you in that all important interview and that you nail it.

Please leave a like or a comment and of course follow the blog for more great posts.

Thanks for reading.

We do this for free so please consider contributing to us below. It really helps.


Support ls /blog


QuBits 2020-07-10



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.