Skip to main content

Command Palette

Search for a command to run...

Must-Know Linux Commands

Essential Linux Commands Every Developer and DevOps Engineer Should Know

Updated
2 min readView as Markdown
Must-Know Linux Commands
A
DevOps Advocate | Passionate about bridging development & operations to build seamless, scalable systems. Let’s connect and geek out over DevOps, open-source, or the latest in cloud innovation! ✨ Building the future, one pipeline at a time.

Introduction

Linux is the backbone of modern development and operations. Whether you're managing servers, working with containers, or automating tasks, these fundamental commands will supercharge your terminal workflow. Let’s dive into the most critical commands every tech professional should master!


1. View Detailed File/Folder Info

ls -l
ls -ltr

(Add -h for human-readable sizes)


2. Search for a Word in a File

grep "term" filename

(Use -r for recursive directory searches)


3. Delete Directory & Contents

rm -rf directory_name

4. Delete a File

rm filename

5. Create a File

touch newfile.txt

6. Navigate Directories

cd /path/to/directory

9. Move/Rename Directories

mv old_dir new_dir

10. Move Files

mv file.txt /target//

  1. Check previous used commands

ctrl + r (each time you press r you get your previous used command)


  1. Update/Upgrade System

sudo apt update #update the package list to ensure latest information on available packages
sudo apt upgrade #upgrade all installed packages to their latest versions
  1. Refresh package list

sudo apt-get update

When Should You Use sudo apt-get update?

  • Before Installing New Software:
    Always run sudo apt-get update before installing new software to ensure you're installing the latest version available.

  • Before Upgrading Installed Packages:
    Run it before using sudo apt-get upgrade or sudo apt-get dist-upgrade to ensure your system knows about the latest updates.

  • After Adding New Repositories:
    If you add a new repository to your system, run this command to refresh the package list and include packages from the new repository.

  1. Install .deb package

sudo apt install ./package-name.deb #./ is mendetory
  1. Extract .tar Package

tar -xf filename.tar
tar -xf filename.tar -C /path/to/directory # to the specific directory
  1. Install all available .deb packages in directory

sudo dpkg -i *.deb # user where all of your .deb package 
sudo apt-get install -f # use if any dependency problem occured

Let me know if you'd like to expand any section or add specific use cases! 🐧

Linux World

Part 1 of 1

Whether you’re a DevOps newbie or a seasoned engineer, Linux is the backbone of modern infrastructure. In this series, I’ll break down Linux concepts, commands, and workflows that power cloud systems, containers, and automation tools.

More from this blog

D

DevOps Enthusiast Blog

8 posts

DevOps Dispatch: Bite-sized insights on CI/CD, cloud, automation tools. Level up your DevOps game! 💡

#DevOps #TechBlog