Must-Know Linux Commands
Essential Linux Commands Every Developer and DevOps Engineer Should Know

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//
Check previous used commands
ctrl + r (each time you press r you get your previous used command)
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
Refresh package list
sudo apt-get update
When Should You Use sudo apt-get update?
Before Installing New Software:
Always runsudo apt-get updatebefore installing new software to ensure you're installing the latest version available.Before Upgrading Installed Packages:
Run it before usingsudo apt-get upgradeorsudo apt-get dist-upgradeto 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.
Install .deb package
sudo apt install ./package-name.deb #./ is mendetory
Extract .tar Package
tar -xf filename.tar
tar -xf filename.tar -C /path/to/directory # to the specific directory
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! 🐧




