Linux Essentials

Most used Linux commands for daily tasks.


System
cat /etc/os-release Distro Information
top Live processes
ps aux List processes
kill pid Kill process
Navigation
ls List files
cd directory Change directory
pwd Print working dir
Files
cp source dest Copy file/dir
mv source dest Move / rename
rm file Remove file
rm -r directory Remove directory tree
touch file Create file/update timestamp
cat file Show file content
grep 'text' file Search in file
grep -i 'text' file Case-insensitive search
grep -n 'text' file Show line numbers
grep -r 'text' directory Recursive search
grep -E 'regex' file Extended regex
grep -v 'text' file Invert match
grep -A 3 -B 2 'text' file Context lines (after 3 / before 2)
find /path -name 'pattern' Find files by name
find /path -type f -size +10M Find large files (>10MB)
locate filename Search indexed database
which command Executable path
Permissions
chmod +x file Make executable
sudo command Run as superuser
Flatpak
flatpak search app Search for applications
flatpak install app-id Install application
flatpak install flathub app-id Install from Flathub
flatpak uninstall app-id Uninstall application
flatpak uninstall --unused Remove unused runtimes
flatpak update Update all applications
flatpak update app-id Update specific app
flatpak list List installed apps
flatpak list --app List only applications
flatpak list --runtime List only runtimes
flatpak run app-id Run application
flatpak info app-id Show app information
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo Add Flathub repository
flatpak remote-list List repositories
flatpak remote-delete remote-name Remove repository
flatpak repair Repair installation
flatpak history Show installation history
flatpak permission-show Show app permissions
flatpak override app-id --filesystem=home Grant home access
flatpak override --reset app-id Reset app overrides