AI Hints
Home›Linux Tutorial›Troubleshooting and Tricks
Linux · Lesson 117 of 120

Interview Questions: Part 1

Files, processes, pipes.

⏱ 2 min read▶ Video at 2:36:55🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

Linux questions come up in interviews for developers, testers, data people, and of course system admins. Here are the classics, with short answers you can give with confidence. Pause, and try each one yourself first.

Interview Questions: Part 1
From the video: Interview Questions: Part 1
  • Developers, testers, admins
  • The classic questions
  • Try each one first

Files and permissions

What's the difference between a hard link and a soft link? A soft link points to a name. A hard link is another name for the same data. What does CH mod seven five five do? The owner can do everything, everyone else can read and run. How do you find files bigger than one gigabyte? Find dash size plus one G.

keyvalue
Soft vs hard linkpointer vs same data
chmod 755rwx r-x r-x
Big filesfind / -size +1G
Who owns it?ls -l

Processes and the system

How do you see what's using the processor? Top, or PSAUX. How do you stop a process that won't quit? Kill, then kill dash nine as a last resort. How do you check disk space? DF dash H. And how do you see which program uses a port? SS dash TLNP.

keyvalue
Processor hogstop, ps aux
Stuck processkill, then kill -9
Disk spacedf -h
Port in usess -tlnp

Text and pipes

What does a pipe do? It sends one command's output into the next command's input. How do you count lines containing error? Grep dash C. What's the difference between greater than, and double greater than? One replaces the file, two appends to it. And what does two greater than do? Redirects errors.

keyvalue
|output into input
grep -c errorcount matching lines
> vs >>replace vs append
2>redirect errors

Summary

Links, permissions, processes, ports, and pipes. These are the questions that come up again and again. Next, part two, with networking and scripting.

Key takeaways
  • ln -s vs ln
  • kill -9 last
  • > vs >>
Next up: Interview Questions: Part 2 — networking and scripts