List Detailed Files
Lists all files including hidden ones with permission, size, and date details
ls -lahWhen to use: When you need to view all files with detailed information, including hidden files (starting with .)
Lose the fear of the black screen. Navigate folders, manage files and control the server without touching the mouse. Survival basics.
Fundamental commands for navigating and manipulating files and directories on Linux.
Lists all files including hidden ones with permission, size, and date details
ls -lahWhen to use: When you need to view all files with detailed information, including hidden files (starting with .)
Copies directories and their content recursively, preserving attributes
cp -r /origem /destinoWhen to use: For backing up entire directories or duplicating folder structures
Moves files/directories or renames if destination is in the same directory
mv arquivo.txt /novo/caminho/mv arquivo_antigo.txt arquivo_novo.txtWhen to use: To organize files or rename them directly via the terminal
Locates files in the system recursively using glob patterns
find /caminho -name "*.log"find . -type f -name "config*"When to use: When you need to locate specific files in large directory structures
Creates multiple levels of directories at once
mkdir -p /projeto/src/components/uiWhen to use: To quickly create complex folder structures without needing to create each level manually
File and directory access control using chmod, chown, and umask.
Sets permissions using octal notation (rwx = 7, rw- = 6, r-x = 5)
chmod 755 script.shchmod 644 arquivo.txtWhen to use: 755 for executables (rwxr-xr-x), 644 for data files (rw-r--r--)
Modifies permissions using symbolic notation (u=user, g=group, o=others)
chmod u+x script.shchmod go-w arquivo.txtWhen to use: When you want to modify specific permissions without changing others
Changes the owner and group of files/directories recursively
chown -R usuario:grupo /var/www/htmlWhen to use: To correct permissions after deployment or web server configuration
Displays file permissions in numeric format
stat -c '%a %n' arquivo.txtWhen to use: To quickly check the numeric value of current permissions
Monitoring, controlling, and manipulating running processes on the system.
Displays all processes of the current user with CPU and memory details
ps aux | grep usuariops -ef | grep nginxWhen to use: To identify PIDs of specific processes or diagnose resource usage
Interactive interface with real-time process updates
tophtopWhen to use: For continuous monitoring of CPU, memory, and identifying problematic processes
Terminates process using different signal levels
kill 1234kill -9 1234kill -SIGTERM 1234When to use: kill for graceful termination, kill -9 to force immediate termination
Terminates all processes matching the name
pkill nginxkillall nodeWhen to use: When you know the process name but not the PID
Starts process in the background, freeing up the terminal
npm run dev &nohup python3 script.py &When to use: To run long scripts without blocking the terminal (nohup keeps it running after logout)
Tools for network diagnostics, file transfer, and connectivity testing.
Sends ICMP packets to check if the host is reachable
ping -c 4 google.comping 192.168.1.1When to use: To check network connectivity and latency (-c limits the number of packets)
Downloads files from the web via HTTP/HTTPS
wget https://example.com/file.zipcurl -O https://example.com/file.tar.gzWhen to use: wget for simple downloads, curl for APIs and more complex requests
Lists all open TCP/UDP ports and associated processes
netstat -tulpnss -tulpnWhen to use: To identify port conflicts or check if a service is listening
Copies files between machines via SSH
scp arquivo.txt user@servidor:/path/scp -r /pasta user@servidor:/destinoWhen to use: To securely transfer files between servers (use -r for directories)
Discovers the machine's public IP address
curl ifconfig.mewget -qO- ifconfig.meWhen to use: To know your public IP when working remotely or configuring firewalls
Installing, updating, and removing software using package managers (APT/YUM).
Synchronizes the list of available packages with repositories
sudo apt updateWhen to use: Always before installing new packages to ensure updated versions
Downloads and installs package with all dependencies
sudo apt install nginx -yWhen to use: To install software via official repositories (-y automatically confirms)
Updates all installed packages to newer versions
sudo apt update && sudo apt upgrade -yWhen to use: Regular system maintenance for security patches and improvements
Uninstalls package, keeping configuration files
sudo apt remove pacotesudo apt purge pacoteWhen to use: remove keeps configs, purge removes everything (useful for clean reinstallation)
Searches for available packages in repositories
apt search python3apt-cache search nodejsWhen to use: To find the exact package name before installing
Commands for getting hardware, OS, and resource usage information.
Displays used and available space on all mounted partitions
df -hWhen to use: To check for sufficient disk space (-h displays in human-readable format)
Calculates total size of directories and files
du -sh /var/logdu -h --max-depth=1 /homeWhen to use: To identify which directories are consuming the most space
Shows RAM and swap usage in human-readable format
free -hWhen to use: To diagnose memory issues or check if swap is being used
Displays processor details (model, cores, frequency)
lscpucat /proc/cpuinfoWhen to use: To check hardware specifications before optimizations
Shows how long the system has been running and average load
uptimeWhen to use: To check server stability and load average
Identifies Linux distribution and kernel version
uname -acat /etc/os-releaseWhen to use: To document environment or check software compatibility