Linux Command Every Engineer Should Use!

KodeKloud · Beginner ·🏗️ Systems Design & Architecture ·2mo ago

Key Takeaways

The video demonstrates how to use the Linux find command to search for files while avoiding permission denied errors by redirecting errors to /dev/null, a technique useful for systems design and administration.

Full Transcript

Let's say you're searching the whole file system for log files, but you're just a regular user, not the root user. So, you run this find command, but all of these permission denied errors are ruining your day. There are more errors than actual found log files. You have to look through all that garbage to find what you need. There's an easy fix. You can just throw these errors away. Just tell your bash shell to dump them into the Linux black hole. And that black hole is {slash} dev {slash} null. At the end of your previous command, you simply add this. And bam, clean result. Just log files shown, no more errors. The magic happens in that part of the command. Two symbolizes errors. The greater than symbol tells bash to redirect these errors. {slash} dev {slash} null is the location where errors should be redirected. And since {slash} dev {slash} null doesn't care what it receives, it just throws that content away. So, you get no more errors on your screen. They are sent into the void that is {slash} dev {slash} null. Now you can get rid of any errors you don't need and get that clean output.

Original Description

Basic Linux terminal searches fail when non-root users encounter flooded screens of "permission denied" errors. Running commands like find across system directories generates noisy error streams that obscure the actual file paths you need to locate. Never let permission errors clutter your search results. Instead, append "2/dev/null" to your command to silence the noise. In bash, the number 2 targets standard error, the operator redirects the stream, and /dev/null acts as a digital black hole that discards every permission error instantly. This simple redirection technique cleans your CLI workflows, helping you spot critical search results instantly without needing full root privileges. #Linux #DevOps #SysAdmin #CommandLine #Bash #TechTips #Infrastructure #Coding
Sign in to unlock AI tutor explanation · ⚡30

The video teaches how to use the Linux find command to search for files while avoiding permission denied errors by redirecting errors to /dev/null, making it easier to find the desired files.

Key Takeaways
  1. Run the find command to search for files
  2. Encounter permission denied errors
  3. Redirect errors to /dev/null using the 2> symbol and the > symbol
  4. Verify clean output without errors
💡 Redirecting errors to /dev/null can simplify the output of Linux commands and make it easier to find the desired information.

Related Reads

📰
From Coder to Architect: Engineering the System One AI & MCP Gateway Stack
Learn how to shift from coding to architecting systems, focusing on structure over syntax, and why this matters for AI and MCP Gateway Stack development
Dev.to AI
📰
Our Senior Engineer Removed 18 Circuit Breakers From Production. I Thought He Was Removing the Last
Learn how to simplify complex systems by removing unnecessary circuit breakers and improving overall system resilience
Medium · Programming
📰
Concurrency Programming (2): Language Memory Models — Rules Programmers Can Rely On
Learn about language memory models and their importance in concurrency programming to write reliable multithreaded code
Dev.to · ThinkerQAQ
📰
📱 Vamos aprender System Design desenhando o WhatsApp
Learn system design by designing WhatsApp, applying principles to real-world scenarios
Dev.to · Freitas-Mp
Up next
Podcast Ep279: Manufacturers Have a Decision Problem, There Is No One Size Fits All ERP
Third Stage Consulting Group
Watch →