# List files and directories in the current location ls # Change directory cd /path/to/dir # Display the content of a file cat file.txt # Print text to the terminal echo "Hello World" # Remove a file or folder (-r for directories) rm file.txt rm -r folder_name # Create a new directory mkdir new_folder # Create an empty file touch new_file.txt # Move or rename a file/directory mv old_name.txt new_name.txt mv file.txt /path/to/destination/ # Copy a file or directory (-r for directories) cp file.txt copy.txt cp -r folder /path/to/destination/ # Search for text inside a file grep "keyword" file.txt # Git commands git init # Initialize a new repository git status # Show the status of files git add . # Add all files to staging git commit -m "Message" # Commit changes with a message # Download files from the internet wget https://example.com/file.zip # Package management (Ubuntu/Debian) apt update apt upgrade apt install package_name # Manage services with systemctl systemctl status service_name systemctl start service_name systemctl stop service_name # Manage services (old command, alternative to systemctl) service service_name start service service_name stop # Monitor processes and system resources top # Basic monitoring tool htop # Advanced monitoring tool (needs installation) # Text editors vi file.txt vim file.txt nano file.txt # View file content page by page less file.txt # Show the first lines of a file head file.txt head -n 20 file.txt # Show first 20 lines # Show the last lines of a file tail file.txt tail -f log.txt # Follow file updates live