10 Core Linux Interview Questions and Answers

Again its time to read some serious content in light mood, Yup! Its another article on Interview question and here we are presenting 10 Core Linux Questions, which surely will add to your knowledge.

Linux Interview Job Questions

10 Core Linux Interview Questions

1. You need to define a macro, a key binding for the existing command. How would you do it?
Answer : There is a command called bind, in bash shell which is capable of defining macro, or binding a key. In order to bind a key with an existing command, we need to generate Character Sequence emitted by the key. Press Ctrl+v and then key F12, I got ^[[24~
[[email protected] ~]# bind '"\e[24~":"date"'

Note : Different types of terminals or terminal emulators can emit different codes for the same key.

2. A user is new to Linux and he wants to know full list of available commands, what would you suggest him?
Answer : A command ‘compgen ­c’ will show a full list of available commands.
[[email protected] ~]$ compgen -c

l.
ll
ls
which
if
then
else
elif
fi
case
esac
for
select
while
until
do
done
...
3. Your assistant needs to print directory stack, what would you suggest?
Answer : The Linux command ‘dirs’, will print the directory stack.
[[email protected] ~]# dirs

/usr/share/X11
4. You have lots of running jobs, how would you remove all the running processes, without restarting the machine?
Answer : The Linux command ‘disown -r’ will remove all the running Processes.
5. What does the command ‘hash’ is used for in bash Shell?
Answer : Linux command ‘hash’ manages internal hash table, fins and remember full path of the specified command, Display used command names and number of times the command is used.
[[email protected] ~]# hash

hits    command
   2    /bin/ls
   2    /bin/su
6. Which built­in Linux command performs arithmetic operation of Integers in Bash?
Answer : The ‘let’ command that performs, arithmetic operation of integer in bash shell.
#! /bin/bash

...

...

let c=a+b

...

...
7. You have a large text file, and you need to see one page at a time. What will you do?
Answer : You can achieve the above result by pipeling the output of ‘cat file_name.txt’ with ‘more’ command.
[[email protected] ~]# cat file_name.txt | more
8. Who own the data dictionary?
Answer : The user ‘SYS’ owns the data dictionary. Users ‘SYS’ and ‘SYSEM are created by default, automatically.
9. How to know a command summary and useability in Linux?

Assume you came across a command in /bin directory, which you are completely unaware of, and have no idea what it does. What will you do to know its useability?

Answer : The command ‘whatis’ display a summary of its useability from the man page. For example, you would like to see a summary of ‘zcat’ command which you don’t know previously.
[[email protected] ~]# whatis zcat

zcat [gzip]          (1)  - compress or expand files
10. What command should you use to check the number of files and disk space used by each user’s defined quotas?
Answer : The command ‘repquota’ comes to rescue here. Command repquota summaries quotas for a file system.

That’s all for now. Provide your valuable Feedback in our comment section. Stay tuned for more Linux and Foss posts.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

19 Responses

  1. James says:

    Seems like I’ve been cut off the link to the web, my xfce and xubuntu systems just totally lost there connection? Wasn’t even hacking at the time, seems like my connection is being made really difficult!! Please can anyone help?

  2. vicky says:

    There should be more core questions, like Boot process, kernel compilation, checking and monitoring CPU, mem and network stats.

  3. Karim says:

    just for fun, using your own technics, I did a whatis on more command which displayed something like :

    # whatis more
    more (1) – file perusal filter for crt viewing
    more (1p) – display files on a page-by-page basis

    Then I applied that to your question number #7 and it showed that you’re contributing to a common misuse of the pipe among sysadmins; in other words no need to pipe cat in more or less

    no need to

    pipe cat in grep, wc, cut
    pipe find in grep
    … you get the point.

    Other than that, as someone said, your article is still useful, I think there is many levels to mastering Linux, and your article is definitely contributing to raising the level up.

  4. brm says:

    I am working as System Administrator (nix) for “AN” NGO.

  5. How is “dirs” different from “pwd” ????

  6. vinod says:

    exellent site in linux

  7. Anand says:

    I loved extracting the good in the article rather than finding negative things like other did.

    Thanks Avishek

  8. champ007 says:

    Good article waiting for some more

  9. Todd says:

    Question #8 is for an Oracle database, not a core Linux knowledge item. Question #7 is often advised as not the best way to do it (google “useless use of cat”).

    The rest are good bash tips though, so maybe a better article title would be “8 Core Bash Interview Q&A”.

  10. Bob says:

    You should learn a bit more about things before writing these articles.
    Your “core linux” things are sometimes bash-specific.
    And you should look up what “UUOC” means and try to understand it.

    • Evil Kitten says:

      Lol yes: why pipeling if you can just do `less file_name.txt`. And as for me, I never use `more` if there is `less`.
      BTW, could I just press Tab-Tab instead of compgen?

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

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