Linux Command Every Engineer Should Use!

KodeKloud · Beginner ·🏗️ Systems Design & Architecture ·1mo 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

📰
Stop Your App From Hammering A Dying Service
Learn to prevent a single broken dependency from taking down your entire app using a simple pattern
Medium · Data Science
📰
The Same Requirement Means Different Things to Security, Architecture, and Operations
Understand how security, architecture, and operations interpret requirements differently to improve collaboration and system design
Medium · AI
📰
Gemini responsded on what exactly is Abstraction in codding
Learn how abstraction applies to coding and algorithms, and why it matters for efficient programming
Medium · Programming
📰
Architectural Breakdown: A Storm Didn't Decide This Battle — A Sergeant Did
Learn how a sergeant's intervention fixed a broken tactics engine, applying problem-solving skills to software development
Dev.to · Muhammad Hammad
Up next
What Is Edge Computing? Explained Simply
Coursera
Watch →