Here you have a compilation of the most useful Linux commands, so you can make the most of your favorite operating system.
Of course, there are many more, and countless possible combinations (some truly long and impossible to remember). If you have any contributions, I would be happy to receive them.
Process and Job Control
View Active Processes
Displays the processes that are running on the system.
ps auxTerminate a Process
Ends a specified process by its PID.
kill PIDRun a Process in the Background
Sends a command to the background.
command &List Background Jobs
Displays the processes that are in the background.
jobsBring a Background Process to the Foreground
Restores a process to the foreground.
fg %nSystem Information and Monitoring
View CPU and Memory Usage
Displays real-time CPU and memory usage of the system.
topDetailed Memory Information
Shows details of memory usage.
free -hShow Disk Space
Verifies disk space usage by partition.
df -hSystem Information
Displays details about the operating system and hardware.
uname -aView System Logs
Checks the system logs.
dmesgFile and Directory Operations
List Files
Lists the files in a directory, including hidden ones.
ls -laMove Files or Directories
Moves files or directories to another location.
mv source destinationCopy Files
Copies files or directories.
cp file destinationDelete Files or Directories
Deletes files (or directories with the -r option).
rm fileCreate Directory
Creates a new directory.
mkdir directory_nameFile Content Operations
Show File Content
Displays the content of a text file.
cat fileShow First Lines of a File
Displays the first 10 lines of a file.
head fileShow Last Lines of a File
Displays the last 10 lines of a file.
tail fileConcatenate and Show Files
Concatenates the content of files.
cat file1 file2View Real-Time Updates of a File
Displays the content of a file that is being updated, useful for logs.
tail -f fileFile and Content Search
Find a File by Name
Searches for files by name in a directory and its subdirectories.
find /path -name "file_name"Search Within File Content
Searches for a string of text in files within a directory.
grep "text" *.txtFind Recently Modified Files
Finds files modified within a specific time range.
find /path -mtime -nUser and Group Management
Add a New User
Creates a new user on the system.
sudo adduser usernameChange a User’s Password
Changes a user’s password.
passwd usernameAdd a User to a Group
Adds a user to a specific group.
sudo usermod -aG group_name usernameDelete a User
Removes a user from the system.
sudo deluser usernamePermissions and Special Attributes
Change Permissions of a File
Changes the permissions of a file or directory (read, write, execute).
chmod 755 fileChange the Owner of a File
Changes the owner and group of a file.
chown user:group fileView File Permissions
Displays permissions and details of files.
ls -lPackaged and Compressed Files
Compress Files in tar.gz
Creates a compressed file in tar.gz format.
tar -czvf file.tar.gz fileDecompress tar.gz Files
Extracts files from a tar.gz file.
tar -xzvf file.tar.gzCompress Files in zip
Creates a compressed file in zip format.
zip file.zip fileDecompress zip Files
Extracts files from a zip file.
unzip file.zipPackage Managers and Repositories
Update Repositories
Updates the list of available packages.
sudo apt updateInstall a Package
Installs a package from the repositories.
sudo apt install package_nameRemove a Package
Uninstalls a package from the system.
sudo apt remove package_nameUpgrade the Entire System
Upgrades all installed packages to the latest version.
sudo apt upgradeFile System Operations
Mount a File System
Mounts a device or partition to a directory.
sudo mount /dev/device /mount_pointUnmount a File System
Unmounts a device or partition.
sudo umount /dev/deviceView Mounted File Systems
Displays the currently mounted file systems.
mountFormat a Partition
Formats a partition to a specific file system.
sudo mkfs -t ext4 /dev/device