Basic Terminal Commands
Linux is more powerful in a CLI (command input) environment than in a GUI (mouse click) environment.
1. File and Directory Management
pwd: Print current directory path (Print Working Directory)ls: List files and folders in the current directory (-aloption recommended)cd [path]: Change directory (cd ..to move to the parent directory)mkdir [name]: Create a new directory (folder)rm [name]: Delete file (rm -rfforcefully deletes a folder, so be careful)cp [source] [target]: Copy file/foldermv [source] [target]: Move file/folder or rename
2. Checking and Editing File Content
cat [file]: Print the entire contents of a filehead/tail [file]: Print the beginning/end of a file (tail -fis useful for checking logs in real-time)grep [string] [file]: Search for a specific string within a fileviorvim: Standard Linux text editor (Exit::q, Save and exit::wq)nano: A text editor that is easy for beginners to use
3. Network and System Information
top/htop: Check real-time system resource (CPU, memory) usagedf -h: Check disk free spacefree -m: Check memory usageip addr: Check network interface information such as IP addressping [address]: Check network connection status
4. Package Management (Ubuntu based)
sudo apt update: Update package listssudo apt install [package]: Install a programsudo apt upgrade: Update all package versions
In the next section, we'll learn about the file permission system, which is the security model of Linux.