Beginner Guide

Linux Fundamentals: The Story of the OS That Runs the World

Updated June 2026
Linux Command Line Splash
Direct, fast, and incredibly powerful. This terminal is your doorway to managing global infrastructure.

Welcome, future tech superstars! Have you ever wondered what powers the apps on your phone, the websites you visit, or the systems that fly rockets into space? The answer is Linux. It is the operating system that runs the modern world.

But don't let names like "Command Line" or "System Administration" scare you. Learning Linux is like learning a superpower, and we are going to start from the very beginning. Grab a cup of hot chocolate, and let's start with a story!

The Story of Linus Torvalds and a "Hobby" Project

Once upon a time in 1991, in Helsinki, Finland, there was a 21-year-old university student named Linus Torvalds. Like many college kids, Linus had a computer, but he was frustrated. The operating systems of that time were either closed, extremely expensive (like UNIX), or simple and unstable.

Linus wanted to tinker with the inner workings of his computer, but closed-source software wouldn't let him see how it worked. So, he decided to write his own operating system core (called a kernel) from scratch.

It was a massive undertaking, but to Linus, it was just a fun sideline. In August 1991, he posted a famous message to an online message board:

"Hello everybody out there... I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones..."

Linus shared his creation online and invited other programmers to view the code, play with it, and help him write it. He released it as open-source, meaning the code was public, and anyone could download it for free.

This simple act of sharing triggered a revolution. Hundreds, then thousands, and eventually millions of software developers around the globe joined in to build, fix, and improve Linux together. Today, Linus's "hobby project" has become the most important software on Earth!

Linus Torvalds Concept Code Workspace
Linus's open sharing philosophy created the largest collaborative engineering effort in human history.

Why is the Whole World Running on Linux Today?

You might think, "I don't use Linux, I use Windows/Mac!" But in reality, you interact with Linux hundreds of times every single day. Here is why:

It's in Your Pocket

Every single Android smartphone is built on top of the Linux kernel. Over 3 billion active devices run on Linux daily!

It Rules the Internet

More than 96% of the top 1 million web servers run Linux. When you search Google, watch Netflix, or browse Instagram, a Linux server handles it.

It is Bulletproof Secure

Because millions of programmers inspect the code daily, bugs and security holes are spotted and fixed almost instantly.

Extreme Stability

Linux servers can run for years without restarting. They power the International Space Station, high-speed bullet trains, and all 500 of the world's fastest supercomputers.

Real-World Scenario: Flipkart Big Billion Days Sale

It’s 12:00 midnight. The blockbuster Flipkart Big Billion Days sale goes live! Millions of shoppers across India load the homepage at the exact same split-second. The servers supporting this massive traffic are hosted in the AWS Mumbai Data Centre (ap-south-1). Suddenly, an application error causes a server slowdown. The developers can't fly a physical engineer to the data centre to attach a monitor or plug in a USB mouse.

Instead, as a DevOps engineer, you open a terminal console from your laptop in Bangalore and securely log into the remote server. But how do you find the problem when there are millions of lines of active user logs? Scrolling through text files manually would take days. Instead, you type a single Linux command: grep "CRITICAL_ERROR" /var/log/flipkart-app.log. Instantly, the terminal filters out all noise and shows you the exact 2 error lines pointing to a database connection bottleneck. You adjust the config, restart the service, and the sale goes on smoothly. That is the power of the Linux CLI!

GUI vs. CLI: The Restaurant Metaphor

If you use Windows or macOS, you are used to a GUI (Graphical User Interface). You point with a mouse, double-click on folders, and press colorful buttons. Linux has a GUI too, but DevOps engineers prefer the CLI (Command Line Interface)—a black screen where you type commands to get things done.

Think of a Computer like a Restaurant Kitchen

Using a GUI is like sitting at a table and ordering from a menu. You look at the options, point to the burger, and click. It's easy, but you are limited. If you want to customize your burger by adding a specific sauce, swapping the buns, and cooking it medium-rare, and the menu doesn't offer it, you are out of luck.

Using a CLI (Terminal) is like walking right into the kitchen and talking to the chef. You can say: "Hey, bake a fresh brioche bun, grill a patty for exactly 4 minutes, add a dash of secret spices, and make 500 of these for a party!"

By talking directly to the system in its own language, you can automate anything. You can tell a Linux server to create 1,000 files, rename them, search them for errors, and send them to the cloud—all with a single typed sentence.

Linux Terminal on Screen
Direct server control: Operating systems across global cloud data centers run almost entirely on Linux CLI.

The Linux Command Line Terminal

To help you understand the Command Line easily, let's see what a terminal looks like. Below is an example showing how directory navigation and paths are checked inside a standard Linux Bash terminal window.

Linux Bash Terminal
student@growthschool:~$ ls
Desktop Documents Downloads projects notes.txt
student@growthschool:~$ pwd
/home/student

50+ Everyday Linux Commands

Here is your essential cheat sheet! We have compiled 50 of the most important, everyday Linux commands, including simple examples and analogies even a school student can understand.

# Purpose Linux Command Real-World Analogy & Example
1 Where am I? pwd Analogy: Checking your GPS map to see your exact location coordinates.
Example: pwd prints /home/student/projects
2 What's inside? ls Analogy: Opening a drawer to see all papers and items inside.
Example: ls -l lists files with details.
3 Move around cd [folder] Analogy: Stepping through a door to enter another room.
Example: cd devops to enter; cd .. to exit.
4 Create folder mkdir [name] Analogy: Placing a new empty box on the shelf with a label.
Example: mkdir my_code creates a new folder.
5 Create empty file touch [file] Analogy: Placing a clean, blank sheet of paper on your desk.
Example: touch notes.txt creates a blank notes file.
6 Read file content cat [file] Analogy: Opening a book page to read the text written on it.
Example: cat config.json displays the file on screen.
7 Copy file cp [src] [dst] Analogy: Making a photocopy of a document so you have a duplicate.
Example: cp notes.txt backup.txt
8 Move or Rename mv [old] [new] Analogy: Moving a box to a new room, or changing its label.
Example: mv test.txt prod.txt renames the file.
9 Delete file rm [file] Analogy: Running a document through a paper shredder permanently.
Example: rm temp.log deletes the temporary log.
10 Delete empty folder rmdir [folder] Analogy: Throwing away a cardboard box that is completely empty.
Example: rmdir old_backup/
11 Force delete folder rm -rf [folder] Analogy: Throwing a chest and everything inside it directly into a furnace.
Example: rm -rf build/ deletes everything recursively.
12 Search inside text grep "[text]" [file] Analogy: Using a yellow highlighter to find a key term in a book.
Example: grep "Success" system.log
13 Network Info / IP ip addr Analogy: Finding your home's mailing address so packages can be delivered.
Example: ip addr show displays your IP details.
14 Ping connectivity ping [host] Analogy: Tapping a microphone and saying "Is this working?" to test response.
Example: ping google.com checks internet status.
15 Who am I? whoami Analogy: Checking the name card pinned to your shirt badge.
Example: whoami output: ubuntu
16 Clear terminal screen clear Analogy: Erasing a chalkboard completely clean to start writing fresh.
Example: clear wipes the screen output history.
17 Command History history Analogy: Flipping through a diary of everything you did yesterday.
Example: history displays past commands you ran.
18 Command Help / Manual man [command] Analogy: Opening the instruction booklet that came with your toy puzzle.
Example: man ls shows options and manual for ls.
19 OS Details uname -a Analogy: Reading the sticker on the back of a TV showing model and build.
Example: uname -a displays kernel details.
20 Check Disk Space df -h Analogy: Checking how many pages are left in your notebook before it's full.
Example: df -h shows human-readable disk details.
21 Check Free RAM free -m Analogy: Checking how much space is left on your kitchen table while cooking.
Example: free -m displays memory in Megabytes.
22 Task Manager top / htop Analogy: Watching the cook's panel showing who is preparing what in real-time.
Example: top shows live CPU and RAM consumption.
23 Stop active task kill [PID] Analogy: Tapping someone's shoulder and telling them to stop working immediately.
Example: kill 1289 kills the process with PID 1289.
24 File Permissions chmod [perms] [file] Analogy: Putting a lock on a diary and choosing who gets the key (Read/Write/Run).
Example: chmod +x run.sh makes a script runnable.
25 File Owner chown [owner] [file] Analogy: Selling your cycle to a friend and writing their name on it as owner.
Example: chown admin notes.txt changes owner to admin.
26 Download file wget [url] / curl Analogy: Calling a courier service to fetch a package from another city.
Example: wget http://example.com/logo.png
27 Read top lines head [file] Analogy: Scanning the title and introductory paragraph of a news article.
Example: head -n 5 log.txt shows first 5 lines.
28 Read bottom lines tail [file] Analogy: Reading the summary page at the very end of a book report.
Example: tail -f logs.txt follows logs in real-time.
29 Current Date/Time date Analogy: Looking at your wristwatch to check the date and time.
Example: date prints the current date on screen.
30 Compare Files diff [f1] [f2] Analogy: Holding two drawings side-by-side to spot the differences.
Example: diff index.html backup.html shows line changes.
31 Remote Connection ssh [user]@[ip] Analogy: Making a secure phone call to log in and talk to a machine in another city.
Example: ssh ubuntu@13.233.1.100 connects to AWS Mumbai.
32 List all processes ps aux Analogy: Looking at a master attendance sheet showing everyone in the school and what they are currently doing.
Example: ps aux | grep nginx finds nginx-related processes.
33 Find process ID pgrep [name] Analogy: Asking "What is student Amit's roll number?" to quickly find their ID.
Example: pgrep chrome returns the PIDs of running Chrome instances.
34 Process Tree pstree -p Analogy: Drawing a family tree showing parent processes and their child processes with their IDs.
Example: pstree -p displays the hierarchical layout of all active processes.
35 Kill by Name killall [name] Analogy: A supervisor announcing "Everyone in the packing department, stop working immediately!"
Example: killall firefox terminates all running Firefox processes.
36 Adjust Priority renice [priority] -p [PID] Analogy: Telling a worker, "Put down the cleaning broom and focus entirely on helping customers right now."
Example: renice 10 -p 1234 sets priority of PID 1234 to 10 (less CPU priority).
37 Manage Jobs jobs / fg / bg Analogy: Moving a kitchen chef to wash dishes in the back room (background) or bringing them back to the counter (foreground).
Example: jobs lists background tasks; fg %1 brings job 1 to foreground.
38 Control Services systemctl [action] [service] Analogy: Turning the main water supply valve on, off, or restarting it for the whole building.
Example: sudo systemctl restart nginx restarts the Nginx service.
39 Active Connections netstat -tn Analogy: Looking at a logbook of all active telephone calls going in and out of an office.
Example: netstat -tn lists active numerical TCP connections.
40 Capture Packets sudo tcpdump -i [interface] port [port] Analogy: Setting up a security camera at a gate to record and inspect every package passing through.
Example: sudo tcpdump -i eth0 port 80 captures web traffic on eth0.
41 Trace Network Path traceroute [host] Analogy: Tracking a shipping parcel at every single transit warehouse it stops at on its way to your house.
Example: traceroute google.com prints list of routers/hops to Google.
42 List Port Owner lsof -i :[port] Analogy: Checking a hotel guest list to see exactly who is staying in room number 80.
Example: lsof -i :8080 shows which process is using port 8080.
43 Socket Statistics ss -tulpn Analogy: A modern, faster digital billboard showing all open doors and who is guarding them.
Example: ss -tulpn lists listening TCP/UDP ports with PIDs.
44 DNS Query dig [domain] / nslookup Analogy: Looking up a person's name in a telephone directory to find their phone number.
Example: dig google.com returns DNS records for Google.
45 Test Port Connection nc -zv [host] [port] Analogy: Knocking on a specific shop door to see if the shop is open and responding.
Example: nc -zv 192.168.1.1 22 checks if SSH port 22 is open on the host.
46 Inspect URL Headers curl -I [url] Analogy: Reading the nutrition label on a food package without opening the package itself.
Example: curl -I https://google.com fetches only the HTTP headers.
47 Service Logs journalctl -u [service] Analogy: Reading the diary of a specific security guard to see everything they did during their shift.
Example: journalctl -u sshd views logs for the SSH service.
48 Read bottom N lines tail -n [number] [file] Analogy: Reading just the final page of a long book to see how it ends.
Example: tail -n 20 error.log shows the last 20 error entries.
49 Read top N lines head -n [number] [file] Analogy: Reading only the cover page and table of contents of a report.
Example: head -n 10 config.txt displays the first 10 configuration lines.
50 Kernel Logs dmesg -T Analogy: Checking the black box voice recorder of an airplane to see all system alerts and boot logs.
Example: dmesg -T | grep -i usb searches hardware logs for USB events.

Pro-Tip for Practice

Want to practice Linux commands directly on your computer? If you are on Windows, you can install WSL2 (Windows Subsystem for Linux), which lets you run a fully-featured Ubuntu terminal inside Windows. Alternatively, downloading Git Bash or launching a free virtual machine on AWS (Mumbai Region) gives you a terminal shell to practice these core commands instantly.

Next Steps on Your DevOps Journey

Congratulations! You just completed the first step towards mastering the foundation of cloud computing and DevOps. By learning how operating systems evolved and getting comfortable with commands, you are ready to explore security permissions next.

Test Your Knowledge

Answer these 35 questions to check your understanding of this module. Click on an option to reveal the correct answer instantly.

Question 1 of 35
Which command is used to list all files, including hidden ones?
A. ls -l
B. ls -a
C. ls -h
D. ls -x
Explanation: The -a flag stands for "all" and includes hidden files starting with a dot.
Question 2 of 35
How do you change the owner of a file?
A. chmod
B. chown
C. chgrp
D. umask
Explanation: chown (change owner) is used to change the file owner and group.
Question 3 of 35
Which directory typically contains configuration files?
A. /bin
B. /dev
C. /etc
D. /lib
Explanation: /etc contains system-wide configuration files.
Question 4 of 35
Which command shows disk usage of files and directories?
A. df
B. du
C. ps
D. top
Explanation: du (disk usage) estimates file space usage; df shows file system disk space usage.
Question 5 of 35
What is the PID of the init/systemd process?
A. 0
B. 1
C. 100
D. 999
Explanation: The init or systemd process is the first process started and always has PID 1.
Question 6 of 35
Which command displays the current working directory?
A. pwd
B. cwd
C. dir
D. ls
Explanation: pwd stands for Print Working Directory.
Question 7 of 35
How do you create a new directory including parent directories if they don’t exist?
A. mkdir -p
B. mkdir -r
C. mkdir -s
D. mkdir -f
Explanation: mkdir -p creates parent directories as needed.
Question 8 of 35
Which command is used to find text patterns within a file?
A. find
B. locate
C. grep
D. sed
Explanation: grep is a powerful utility for searching plain-text data sets for lines that match a regular expression.
Question 9 of 35
Which permission code represents read, write, and execute for the owner?
A. 4
B. 5
C. 6
D. 7
Explanation: 7 (4+2+1) represents Read(4) + Write(2) + Execute(1).
Question 10 of 35
How do you check the kernel version?
A. uname -r
B. linux -v
C. ver
D. kernel -s
Explanation: uname -r prints the kernel release version.
Question 11 of 35
Which command displays real-time system processes?
A. ps
B. top
C. jobs
D. proc
Explanation: top provides a dynamic real-time view of a running system.
Question 12 of 35
How do you force kill a process with PID 1234?
A. kill 1234
B. kill -9 1234
C. stop 1234
D. end 1234
Explanation: kill -9 sends the SIGKILL signal which forces the process to terminate immediately.
Question 13 of 35
What does the command "touch file.txt" do?
A. Opens the file
B. Deletes the file
C. Updates timestamp or creates empty file
D. Changes file permissions
Explanation: touch updates the access and modification times, or creates an empty file if it does not exist.
Question 14 of 35
Which file contains user password information (encrypted)?
A. /etc/passwd
B. /etc/shadow
C. /etc/group
D. /etc/secure
Explanation: /etc/shadow contains encrypted user passwords.
Question 15 of 35
Which symbol redirects output to a file, overwriting it?
A. >>
B. >
C. <
D. |
Explanation: > redirects output and overwrites; >> appends.
Question 16 of 35
What is the default port for SSH?
A. 21
B. 22
C. 23
D. 80
Explanation: Port 22 is the standard port for Secure Shell (SSH).
Question 17 of 35
Which command is used to view the last few lines of a file?
A. head
B. tail
C. less
D. cat
Explanation: tail outputs the last part of files.
Question 18 of 35
Which command compresses files into a .tar.gz archive?
A. tar -cvf
B. tar -xvf
C. tar -czvf
D. tar -uzvf
Explanation: -c (create), -z (gzip), -v (verbose), -f (file).
Question 19 of 35
How do you check free memory space?
A. df
B. free
C. mem
D. du
Explanation: free displays the amount of free and used memory in the system.
Question 20 of 35
Which command shows network interface configuration?
A. ifconfig
B. netstat
C. ping
D. route
Explanation: ifconfig (or ip addr) is used to configure/view network interfaces.
Question 21 of 35
What does "chmod 755" mean?
A. Owner: rwx, Group: rwx, Others: rwx
B. Owner: rwx, Group: rx, Others: rx
C. Owner: rw, Group: r, Others: r
D. Owner: rwx, Group: -, Others: -
Explanation: 7 (rwx) for owner, 5 (rx) for group, 5 (rx) for others.
Question 22 of 35
Which command creates a symbolic link?
A. ln -s
B. ln -h
C. link -s
D. sl -n
Explanation: ln -s creates a symbolic (soft) link.
Question 23 of 35
What is /dev/null?
A. The root directory
B. A temporary folder
C. A device file that discards all data written to it
D. The boot loader
Explanation: /dev/null is the null device, discarding all data written to it (black hole).
Question 24 of 35
Which command removes a directory and its contents recursively?
A. rm -r
B. rmdir
C. del /s
D. erase -r
Explanation: rm -r (recursive) removes directories and their contents.
Question 25 of 35
Which command displays the manual page of a command?
A. help
B. man
C. info
D. doc
Explanation: man formats and displays the on-line manual pages.
Question 26 of 35
Which command is used to display a detailed, real-time snapshot of all running processes in Linux?
A. pgrep
B. ps aux
C. pstree
D. jobs
Explanation: ps aux lists all running processes with user name, CPU/memory usage, and process details.
Question 27 of 35
How can you find only the Process ID (PID) of all running chrome instances without listing other details?
A. pgrep chrome
B. ps aux | grep chrome
C. killall chrome
D. pid chrome
Explanation: pgrep [process_name] directly returns the PIDs matching the search name.
Question 28 of 35
Which command displays active TCP connections along with their numerical addresses?
A. ip addr
B. traceroute
C. netstat -tn
D. ping
Explanation: netstat -tn displays active TCP connections using numerical IP addresses and ports.
Question 29 of 35
How do you find which process is listening on port 8080?
A. ping -p 8080 localhost
B. lsof -i :8080
C. netstat -a
D. traceroute :8080
Explanation: lsof -i :[port] lists open files and processes using a specific network port.
Question 30 of 35
Which tool is used to trace the route and intermediate hops that packets take to reach a destination?
A. ping
B. nslookup
C. traceroute
D. tcpdump
Explanation: traceroute traces the path of packets through network routers to a remote host.
Question 31 of 35
Which command is used to capture and analyze network packets passing through a specific interface?
A. tcpdump
B. netstat
C. ss
D. lsof
Explanation: tcpdump is a command-line packet analyzer that captures network traffic.
Question 32 of 35
How do you view the system logs specifically for a systemd service named 'nginx'?
A. cat /var/log/nginx
B. tail nginx
C. journalctl -u nginx
D. systemctl log nginx
Explanation: journalctl -u [service_name] retrieves and filters systemd logs for a specific unit/service.
Question 33 of 35
Which command displays the kernel ring buffer logs with human-readable timestamps?
A. uname -a
B. dmesg -T
C. journalctl -k
D. cat /var/log/kernel
Explanation: dmesg -T displays messages from the kernel ring buffer, translating timestamps into human-readable date and time.
Question 34 of 35
Which command checks if port 22 is open on a remote server at IP 192.168.1.1 without initiating a full session?
A. ssh 192.168.1.1
B. nc -zv 192.168.1.1 22
C. ping 192.168.1.1:22
D. nslookup 192.168.1.1
Explanation: nc -zv [host] [port] tests connectivity to a specific port in zero-I/O mode (without sending data).
Question 35 of 35
What is the correct syntax to display only the first 15 lines of a log file named 'server.log'?
A. tail -n 15 server.log
B. head -n 15 server.log
C. cat -n 15 server.log
D. show -n 15 server.log
Explanation: head -n [number] outputs the first N lines of a file.

Real-Time Interview Questions & Answers

1. How do Linux file permissions work, and what is the difference between 755 and 644 permissions?

Answer: Permissions are split into Owner, Group, and Others. Each digit represents the sum of Read (4), Write (2), and Execute (1). 755 allows the owner to read/write/execute, and others to read/execute. 644 allows the owner to read/write, and others to only read.

Example: “I recursively set directories to 755 and files to 644 in web roots like /var/www to ensure users can browse directories but cannot write files maliciously.”

2. How do you troubleshoot a 'disk full' error if `df -h` shows 100% usage, but `du -sh` of all directories shows much less?

Answer: This happens when deleted files are still held open by running processes. The space is not freed until the process is terminated or restarted.

Example: “I use `lsof +L1` to find deleted files still held open by active processes, then reload or restart the service (like NGINX or httpd) to free up the space.”

3. How do you locate files modified in the last 24 hours containing the word 'error' in `/var/log`?

Answer: I combine the `find` command to look for files modified within 24 hours and pipe it to `grep` or use the `-exec` option of `find` to search for text.

Example: “I run `find /var/log -mtime -1 -type f -exec grep -i 'error' {} +` to quickly locate errors in active server logs from the past day.”

4. What is the difference between soft limits and hard limits for user resources in `/etc/security/limits.conf`?

Answer: A soft limit is the default value that users can temporarily increase up to the hard limit. The hard limit is a strict ceiling enforced by the root user that users cannot exceed.

Example: “We set the soft open files limit (`nofile`) to 8192 and the hard limit to 65536 for the application user to allow scaling under high traffic load.”

5. How do you troubleshoot high CPU utilization on a Linux server?

Answer: I run `top` or `htop` to identify the processes consuming the most CPU. Inside `top`, I can press `Shift+P` to sort by CPU usage, and `H` to see thread-level metrics.

Example: “If I notice a high CPU spike, I run `top -b -n 1` to capture CPU state snapshot, then inspect the process IDs to see if they belong to background cron jobs.”

6. How do you set up a cron job to run a script every 5 minutes and capture its logs?

Answer: I open the cron editor using `crontab -e` and add the cron syntax `*/5 * * * *` followed by the absolute path of the script and redirection symbols.

Example: “I configure cron jobs as `*/5 * * * * /opt/scripts/cleanup.sh >> /var/log/cleanup.log 2>&1` to ensure both standard logs and errors are captured.”

7. What is the difference between `systemctl start` and `systemctl enable`?

Answer: `start` runs the service immediately in the current session but does not persist across restarts. `enable` configures the service symlinks so it starts automatically during the system boot sequence.

Example: “When setting up a database server, I run `systemctl enable postgresql` to guarantee the database starts up automatically if the VM restarts.”

8. How do you verify if a specific port is open and listening on a remote server?

Answer: I use networking commands like `telnet`, `nc` (netcat), or `curl` to probe the remote port. `nc -zv ` is the most effective command.

Example: “Before deploying, I run `nc -zv db-host 5432` to confirm our database is accepting connections on port 5432 from our app host.”

9. How do you check memory utilization, and what do the 'cached' and 'buffers' fields mean in `free -m`?

Answer: 'Cached' memory is RAM used by Linux to store files read from disk for faster access. Linux automatically reclaims this memory if applications need it, so it should not be treated as exhausted memory.

Example: “I always look at the 'available' column in `free -m` rather than 'free' to check how much memory our application can actually allocate.”

10. How do you secure SSH access to a Linux production server?

Answer: I modify `/etc/ssh/sshd_config` to disable root login (`PermitRootLogin no`), disable password logins (`PasswordAuthentication no`), and specify key-based authentication.

Example: “To block automated brute-force attacks, I changed our SSH configuration to passwordless access and set up Fail2ban to block suspicious IPs.”

11. What is the difference between a hard link and a soft link (symlink)?

Answer: A soft link is a shortcut pointing to the file path name. If the original file is deleted, the link breaks. A hard link points directly to the file's underlying inode on the disk, remaining valid even if the original name is deleted.

Example: “We use soft links `ln -s` to point system configuration folders to application directories across different mounted drives.”

12. How do you monitor log files in real-time, filtering out specific strings?

Answer: I use `tail -f` to watch files in real-time and pipe it to `grep` to filter out specific keywords.

Example: “To debug authentication failures live, I run `tail -f /var/log/secure | grep -i 'failed'` while trying to connect.”

13. How do you add a new user and grant them sudo permissions in Linux?

Answer: I use `useradd` to create the account, and then add the user to the sudo group (called `sudo` on Ubuntu/Debian or `wheel` on CentOS/RHEL) using `usermod`.

Example: “I ran `usermod -aG wheel developer1` to grant administrative permissions to the new developer's account on our CentOS server.”

14. What are package managers, and how do you configure custom repositories?

Answer: Package managers (like apt, yum, dnf) resolve dependencies and download software. Custom repositories are added by creating `.repo` files in `/etc/yum.repos.d/` or lists in `/etc/apt/sources.list.d/`.

Example: “I created `/etc/yum.repos.d/docker-ce.repo` to configure the official Docker repository, allowing us to install and update Docker CE via yum.”

15. How do you find out which process is listening on a specific port in Linux?

Answer: I use command-line utilities like `ss`, `netstat`, or `lsof` with root privileges to trace the port allocation.

Example: “I run `ss -tulpn | grep :8080` to find the Process ID (PID) of the application currently blocking port 8080.”
Live Sandbox

Don't Just Read. Code Live!

Practice what you just learned in our secure, zero-setup interactive labs. Boot up Linux containers, orchestrate AWS infrastructure, and run Docker right in your browser.

100% Free & Interactive for Growth School Community No Setup Required Real-time Terminal Feedback
Start Live Sandbox
ubuntu@growthschool:~

docker run -d -p 80:80 nginx

Unable to find image 'nginx:latest' locally...

latest: Pulling from library/nginx

Digest: sha256:4c087b3289aa6b185...

Status: Downloaded newer image for nginx:latest

Container running at http://localhost:80

_