Linux
Linux 101 17 questions
- #1What is Linux?
- #2Explain what each of the following commands does and give an example on how to use it:
- touch
- ls
- rm
- cat
- cp
- mkdir
- pwd
- cd
- touch
- #3What each of the following commands does?
- cd /
- cd ~
- cd
- cd ..
- cd .
- cd -
- cd /
- #4Some of the commands in the previous question can be run with the -r/-R flag. What does it do? Give an example to when you would use it
- #5Explain each field in the output of
ls -lcommand - #6What are hidden files/directories? How to list them?
- #7What do > and < do in terms of input and output for programs?
- #8Explain what each of the following commands does and give an example on how to use it:
- sed
- grep
- cut
- awk
- sed
- #9How to rename the name of a file or a directory?
- #10Specify which command would you use (and how) for each of the following scenarios
- Remove a directory with files
- Display the content of a file
- Provides access to the file /tmp/x for everyone
- Change working directory to user home directory
- Replace every occurrence of the word "good" with "great" in the file /tmp/y
- Remove a directory with files
- #11How can you check what is the path of a certain command?
- #12What is the difference between these two commands? Will it result in the same output?
echo hello world echo "hello world" - #13Explain piping. How do you perform piping?
- #14Fix the following commands:
- sed "s/1/2/g' /tmp/myFile
- find . -iname *.yaml -exec sed -i "s/1/2/g" {} ;
- sed "s/1/2/g' /tmp/myFile
- #15How to check which commands you executed in the past?
- #16Running the command df you get "command not found". What could be wrong and how to fix it?
- #17How do you schedule tasks periodically?
I/O Redirection 5 questions
- #18Explain Linux I/O redirection
- #19Demonstrate Linux output redirection
- #20Demonstrate Linux stderr output redirection
- #21Demonstrate Linux stderr to stdout redirection
- #22What is the result of running the following command? yippiekaiyay 1>&2 die_hard
Filesystem Hierarchy Standard 8 questions
- #23In Linux FHS (Filesystem Hierarchy Standard) what is the /?
- #24What is stored in each of the following paths?
- /bin, /sbin, /usr/bin and /usr/sbin
- /etc
- /home
- /var
- /tmp
- /bin, /sbin, /usr/bin and /usr/sbin
- #25What is special about the /tmp directory when compared to other directories?
- #26What kind of information one can find in /proc?
- #27What makes /proc different from other filesystems?
- #28True or False? only root can create files in /proc
- #29What can be found in /proc/cmdline?
- #30In which path can you find the system devices (e.g. block storage)?
Permissions 11 questions
- #31How to change the permissions of a file?
- #32What does the following permissions mean?:
- 777
- 644
- 750
- 777
- #33What this command does? chmod +x some_file
- #34Explain what is setgid and setuid
- #35What is the purpose of sticky bit?
- #36What the following commands do?
- chmod
- chown
- chgrp
- chmod
- #37What is sudo? How do you set it up?
- #38True or False? In order to install packages on the system one must be the root user or use the sudo command
- #39Explain what are ACLs. For what use cases would you recommend to use them?
- #40You try to create a file but it fails. Name at least three different reason as to why it could happen
- #41A user accidentally executed the following chmod -x $(which chmod). How to fix it?
Scenarios 3 questions
- #42You would like to copy a file to a remote Linux host. How would you do?
- #43How to generate a random string?
- #44How to generate a random string of 7 characters?
Systemd 5 questions
- #45What is systemd?
- #46How to start or stop a service?
- #47How to check the status of a service?
- #48On a system which uses systemd, how would you display the logs?
- #49Describe how to make a certain process/app a service
Troubleshooting and Debugging 12 questions
- #50Where system logs are located?
- #51How to follow file's content as it being appended without opening the file every time?
- #52What are you using for troubleshooting and debugging network issues?
- #53What are you using for troubleshooting and debugging disk & file system issues?
- #54What are you using for troubleshooting and debugging process issues?
- #55What are you using for debugging CPU related issues?
- #56You get a call from someone claiming "my system is SLOW". What do you do?
- #57Explain iostat output
- #58How to debug binaries?
- #59What is the difference between CPU load and utilization?
- #60How you measure time execution of a program?
- #61You have a process writing to a file. You don't know which process exactly, you just know the path of the file. You would like to kill the process as it's no longer needed. How would you achieve it?
Kernel 13 questions
- #62What is a kernel, and what does it do?
- #63How do you find out which Kernel version your system is using?
- #64What is a Linux kernel module and how do you load a new module?
- #65Explain user space vs. kernel space
- #66In what phases of kernel lifecycle, can you change its configuration?
- #67Where can you find kernel's configuration?
- #68Where can you find the file that contains the command passed to the boot loader to run the kernel?
- #69How to list kernel's runtime parameters?
- #70Will running sysctl -a as a regular user vs. root, produce different result?
- #71You would like to enable IPv4 forwarding in the kernel, how would you do it?
- #72How sysctl applies the changes to kernel's runtime parameters the moment you run sysctl command?
- #73How changes to kernel runtime parameters persist? (applied even after reboot to the system for example)
- #74Are the changes you make to kernel parameters in a container, affects also the kernel parameters of the host on which the container runs?
SSH 7 questions
- #75What is SSH? How to check if a Linux server is running SSH?
- #76Why SSH is considered better than telnet?
- #77What is stored in ~/.ssh/known_hosts?
- #78You try to ssh to a server and you get "Host key verification failed". What does it mean?
- #79What is the difference between SSH and SSL?
- #80What ssh-keygen is used for?
- #81What is SSH port forwarding?
Globbing & Wildcards 11 questions
- #82What is Globbing?
- #83What are wildcards? Can you give an example of how to use them?
- #84Explain what will ls [XYZ] match
- #85Explain what will ls [^XYZ] match
- #86Explain what will ls [0-5] match
- #87What each of the following matches
- ?
- ?
- #88What do we grep for in each of the following commands?:
- grep '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' some_file
- grep -E "error|failure" some_file
- grep '[0-9]$' some_file
- grep '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' some_file
- #89Which line numbers will be printed when running
grep '\baaa\b'on the following content:aaa bbb ccc.aaa aaaaaa
- #90What is the difference single and double quotes?
- #91What is escaping? What escape character is used for escaping?
- #92What is an exit code? What exit codes are you familiar with?
Boot Process 4 questions
- #93Tell me everything you know about the Linux boot process
- #94What is GRUB2?
- #95What is Secure Boot?
- #96What can you find in /boot?
Disk and Filesystem 23 questions
- #97What's an inode?
- #98Which of the following is not included in inode:
- Link count
- File size
- File name
- File timestamp
- Link count
- #99How to check which disks are currently mounted?
- #100You run the mount command but you get no output. How would you check what mounts you have on your system?
- #101What is the difference between a soft link and hard link?
- #102True or False? You can create an hard link for a directory
- #103True or False? You can create a soft link between different filesystems
- #104True or False? Directories always have by minimum 2 links
- #105What happens when you delete the original file in case of soft link and hard link?
- #106Can you check what type of filesystem is used in /home?
- #107What is a swap partition? What is it used for?
- #108How to create a
- new empty file
- a file with text (without using text editor)
- a file with given size
- new empty file
- #109You are trying to create a new file but you get "File system is full". You check with df for free space and you see you used only 20% of the space. What could be the problem?
- #110How would you check what is the size of a certain directory?
- #111What is LVM?
- #112Explain the following in regards to LVM:
- PV
- VG
- LV
- PV
- #113What is NFS? What is it used for?
- #114What RAID is used for? Can you explain the differences between RAID 0, 1, 5 and 10?
- #115Describe the process of extending a filesystem disk space
- #116What is lazy umount?
- #117What is tmpfs?
- #118What is stored in each of the following logs?
- /var/log/messages
- /var/log/boot.log
- /var/log/messages
- #119True or False? both /tmp and /var/tmp cleared upon system boot
Performance Analysis 6 questions
- #120How to check what is the current load average?
- #121You know how to see the load average, great. but what each part of it means? for example 1.43, 2.34, 2.78
- #122How to check process usage?
- #123How to check disk I/O?
- #124How to check how much free memory a system has? How to check memory consumption by each process?
- #125How to check TCP stats?
Processes 27 questions
- #126how to list all the processes running in your system?
- #127How to run a process in the background and why to do that in the first place?
- #128How can you find how much memory a specific process consumes?
- #129What signal is used by default when you run 'kill process id'?
- #130What signals are you familiar with?
- #131What kill 0 does?
- #132What kill -0 does?
- #133What is a trap?
- #134Every couple of days, a certain process stops running. How can you look into why it's happening?
- #135What happens when you press ctrl + c?
- #136What is a Daemon in Linux?
- #137What are the possible states of a process in Linux?
- #138How do you kill a process in D state?
- #139What is a zombie process?
- #140How to get rid of zombie processes?
- #141How to find all the
- Processes executed/owned by a certain user
- Process which are Java processes
- Zombie Processes
- Processes executed/owned by a certain user
- #142What is the init process?
- #143Can you describe how processes are being created?
- #144How to change the priority of a process? Why would you want to do that?
- #145Can you explain how network process/connection is established and how it's terminated?>
- #146What strace does? What about ltrace?
- #147Find all the files which end with '.yml' and replace the number 1 in 2 in each file
- #148You run ls and you get "/lib/ld-linux-armhf.so.3 no such file or directory". What is the problem?
- #149How would you split a 50 lines file into 2 files of 25 lines each?
- #150What is a file descriptor? What file descriptors are you familiar with?
- #151What is NTP? What is it used for?
- #152Explain Kernel OOM
Security 9 questions
- #153What is chroot? In what scenarios would you consider using it?
- #154What is SELiunx?
- #155What is Kerberos?
- #156What is nftables?
- #157What firewalld daemon is responsible for?
- #158Do you have experience with hardening servers? Can you describe the process?
- #159How do you create a private key for a CA (certificate authority)?
- #160How do you create a public key for a CA (certificate authority)?
- #161Demonstrate one way to encode and decode data in Linux
Networking 18 questions
- #162How to list all the interfaces?
- #163What is the loopback (lo) interface?
- #164What the following commands are used for?
- ip addr
- ip route
- ip link
- ping
- netstat
- traceroute
- ip addr
- #165What is a network namespace? What is it used for?
- #166How to check if a certain port is being used?
- #167How can you turn your Linux server into a router?
- #168What is a virtual IP? In what situation would you use it?
- #169True or False? The MAC address of an interface is assigned/set by the OS
- #170Can you have more than one default gateway in a given system?
- #171What is telnet and why is it a bad idea to use it in production? (or at all)
- #172What is the routing table? How do you view it?
- #173How can you send an HTTP request from your shell?
- #174What are packet sniffers? Have you used one in the past? If yes, which packet sniffers have you used and for what purpose?
- #175How to list active connections?
- #176How to trigger neighbor discovery in IPv6?
- #177What is network interface bonding and do you know how it's performed in Linux?
- #178What network bonding modes are there?
- #179What is a bridge? How it's added in Linux OS?
DNS 5 questions
- #180How to check what is the hostname of the system?
- #181What the file /etc/resolv.conf is used for? What does it include?
- #182What commands are you using for performing DNS queries (or troubleshoot DNS related issues)?
- #183You run dig codingshell.com and get the following result:
ANSWER SECTION: codingshell.com. 3515 IN A 185.199.109.153What is the meaning of the number 3515?
- #184How can we modify the network connection via
nmclicommand, to use8.8.8.8as a DNS server?
Packaging 9 questions
- #185Do you have experience with packaging? (as in building packages) Can you explain how does it works?
- #186How packages installation/removal is performed on the distribution you are using?
- #187RPM: explain the spec format (what it should and can include)
- #188How do you list the content of a package without actually installing it?
- #189How to know to which package a file on the system belongs to? Is it a problem if it doesn't belongs to any package?
- #190Where repositories are stored? (based on the distribution you are using)
- #191What is an archive? How do you create one in Linux?
- #192How to extract the content of an archive?
- #193Why do we need package managers? Why not simply creating archives and publish them?
DNF 2 questions
- #194What is DNF?
- #195How to look for a package that provides the command /usr/bin/git? (the package isn't necessarily installed)
Applications and Services 6 questions
- #196What can you find in /etc/services?
- #197How to make sure a Service starts automatically after a reboot or crash?
- #198You run ssh 127.0.0.1 but it fails with "connection refused". What could be the problem?
- #199How to print the shared libraries required by a certain program? What is it useful for?
- #200What is CUPS?
- #201What types of web servers are you familiar with?
Users and Groups 15 questions
- #202What is a "superuser" (or root user)? How is it different from regular users?
- #203How do you create users? Where user information is stored?
- #204Which file stores information about groups?
- #205How do you change/set the password of a user?
- #206Which file stores users passwords? Is it visible for everyone?
- #207Do you know how to create a new user without using adduser/useradd command?
- #208What information is stored in /etc/passwd? explain each field
- #209How to add a new user to the system without providing him the ability to log-in into the system?
- #210How to switch to another user? How to switch to the root user?
- #211What is the UID the root user? What about a regular user?
- #212What can you do if you lost/forogt the root password?
- #213What is /etc/skel?
- #214How to see a list of who logged-in to the system?
- #215Explain what each of the following commands does:
- useradd
- usermod
- whoami
- id
- useradd
- #216You run grep $(whoami) /etc/passwd but the output is empty. What might be a possible reason for that?
Hardware 4 questions
- #217Where can you find information on the processor (like number of CPUs)?
- #218How can you print information on the BIOS, motherboard, processor and RAM?
- #219How can you print all the information on connected block devices in your system?
- #220True or False? In user space, applications don't have full access to hardware resources
Namespaces 7 questions
- #221What types of namespaces are there in Linux?
- #222True or False? In every PID (Process ID) namespace the first process assigned with the process id number 1
- #223True or False? In a child PID namespace all processes are aware of parent PID namespace and processes and the parent PID namespace has no visibility of child PID namespace processes
- #224True or False? By default, when creating two separate network namespaces, a ping from one namespace to another will work fine
- #225True or False? With UTS namespaces, processes may appear as if they run on different hosts and domains while running on the same host
- #226True or False? It's not possible to have a root user with ID 0 in child user namespaces
- #227What time namespaces are used for?
Virtualization 3 questions
- #228What virtualization solutions are available for Linux?
- #229What is KVM?
- #230What is Libvirt?
AWK 6 questions
- #231What the awk command does? Have you used it? What for?
- #232How to print the 4th column in a file?
- #233How to print every line that is longer than 79 characters?
- #234What the lsof command does? Have you used it? What for?
- #235What is the difference between find and locate?
- #236How a user process performs a privileged operation, such as reading from the disk?
System Calls 22 questions
- #237What is a system call? What system calls are you familiar with?
- #238How a program executes a system call?
- #239Explain the fork() system call
- #240What is the return value of fork()?
- #241Name one reason for fork() to fail
- #242Why do we need the wait() system call?
- #243How the kernel notifies the parent process about child process termination?
- #244How the waitpid() is different from wait()?
- #245True or False? The wait() system call won't return until the child process has run and exited
- #246Explain the exec() system call
- #247True or False? A successful call to exec() never returns
- #248What system call is used for listing files?
- #249What system calls are used for creating a new process?
- #250What execve() does?
- #251What is the return value of malloc?
- #252Explain the pipe() system call. What does it used for?
- #253What happens when you execute ls -l?
- #254What happens when you execute ls -l *.log?
- #255What readdir() system call does?
- #256What exactly the command alias x=y does?
- #257Why running a new program is done using the fork() and exec() system calls? why a different API wasn't developed where there is one call to run a new program?
- #258Describe shortly what happens when you execute a command in the shell
Filesystem & Files 6 questions
- #259How to create a file of a certain size?
- #260What does the following block do?:
open("/my/file") = 5 read(5, "file content") - #261Describe three different ways to remove a file (or its content)
- #262What is the difference between a process and a thread?
- #263What is context switch?
- #264You found there is a server with high CPU load but you didn't find a process with high CPU. How is that possible?
Advanced Networking 10 questions
- #265When you run ip a you see there is a device called 'lo'. What is it and why do we need it?
- #266What the traceroute command does? How does it works?
- #267What is network bonding? What types are you familiar with?
- #268How to link two separate network namespaces so you can ping an interface on one namespace from the second one?
- #269What are cgroups?
- #270Explain Process Descriptor and Task Structure
- #271What are the differences between threads and processes?
- #272Explain Kernel Threads
- #273What happens when socket system call is used?
- #274You executed a script and while still running, it got accidentally removed. Is it possible to restore the script while it's still running?
Memory 3 questions
- #275What is the difference between MemFree and MemAvailable in /proc/meminfo?
- #276What is the difference between paging and swapping?
- #277Explain what is OOM killer
Distributions 3 questions
- #278What is a Linux distribution?
- #279What Linux distributions are you familiar with?
- #280What are the components of a Linux distribution?
Sed 1 question
- #281Using sed, extract the date from the following line: 201.7.19.90 - - [05/Jun/1985:13:42:99 +0000] "GET /site HTTP/1.1" 200 32421
Misc 17 questions
- #282What is a Linux distribution?
- #283Name 5 commands which are two letters long
- #284What ways are there for creating a new empty file?
- #285How
cd -works? How does it knows the previous location? - #286List three ways to print all the files in the current directory
- #287How to count the number of lines in a file? What about words?
- #288You define x=2 in /etc/bashrc and x=6 ~/.bashrc you then login to the system. What would be the value of x?
- #289What is the difference between man and info?
- #290Explain "environment variables". How do you list all environment variables?
- #291What is a TTY device?
- #292How to create your own environment variables?
- #293What a double dash (--) mean?
- #294Wildcards are implemented on user or kernel space?
- #295If I plug a new device into a Linux machine, where on the system, a new device entry/file will be created?
- #296Why there are different sections in man? What is the difference between the sections?
- #297What is User-mode Linux?
- #298Under which license Linux is distributed?