Ubuntu Commands
This page serves as a quick reference for essential Ubuntu commands, designed to help developers and system administrators efficiently manage their Linux environments. Mastering these commands can significantly streamline your workflow, from file transfers and disk management to service control and process monitoring.
File Transfer and Management
Securely copy files between your local machine and remote servers, or check disk space usage.
scp /path/to/file user@server:/path/to/destination # Copy file from local to server
scp user@remote_host:remote_file local_file # download: remote -> local
scp local_file user@remote_host:remote_file # upload: local -> remote
df -h # Check the amount of free space
Firewall and Network Configuration
Manage your firewall rules to control network access and view network configurations.
sudo ufw status # Check status
sudo ufw allow from remote_IP_address to any port 3306 # Allow external ip to access port
ip r # Display ip of the server
lsof -i :9000 # List process running on port 9000
Service and Process Management
Restart services, gain root privileges, and monitor running processes.
service elasticsearch restart # Restart elasticsearch service
sudo -s # Log as root
ps -ax | grep myprocessname # Search processes
kill -9 PROCESS_ID # Kill process PID
System Monitoring and Logging
Inspect memory usage, view system logs, and resize file systems.
cat /proc/<process_id>/maps # Show the current virtual memory usage of a Linux process
journalctl -u minio.service -n 100 --no-pager # List last 100 logs for specific service
sudo resize2fs /dev/disk/by-id/scsi-0DO_example # Resize volume
Further Resources
For more in-depth information on these commands and other Linux utilities, consult the official Ubuntu documentation and resources like the Linux Man Pages.
- Ubuntu Man Pages
- MDN Web Docs - MIME Types (Example of a relevant external resource)
- Bash Reference Manual