The Linux terminal is a command line interface through which users can interact with the operating system and perform various operations. Here are some commonly used Linux terminal commands and their meanings:
- ls: List files and folders in the current directory
- cd: Change the current working directory
- mkdir: Create a new folder
- rm: delete a file or folder
- cp: Copy a file or folder
- mv: move or rename a file or folder
- cat: View the contents of a file
- more: View the contents of the file, displayed page by page
- less: View the contents of the file and turn pages using the up and down keys.
- vi: edit files
- grep: Search for a specified string in a file
- find: Find the specified file or folder
- uptime: displays the time the system has been running
- top: Displays the process status of the current system
- df: Displays the disk usage of the current system
- kill: kill a process
- ls -al: List all files and folders in the current directory, including hidden files
- ls -at: Sort files by creation time
- ls -alh: Sort by file size
- ls -ah: Sort by file name indentation
- cd ~: Switch to the user's home directory
- mkdir new_dir: Create a new folder
- rm -rf file: force file deletion
- cp -r file new_dir: Copy the file to the folder
- mv new_dir/ file: Move files into folders
- cat /dev/null: View empty file contents
- more /dev/null: View the contents of empty files, displayed page by page
- less /dev/null: View the contents of empty files, and you can turn pages by pressing the up and down keys.
- vi+: Insert content at the beginning of the current line in the file
- vi -: Insert content at the end of the current line in the file
- vi e: Edit content at the beginning of the current line in the file
- vi o: Edit content at the end of the current line in the file
- vi s: edit content in the middle of the current line in the file
- find . -name "file": Find the file named "file" in the current directory
- find . -type f -name "file": Find files named "file" in the current directory, only display files
- find . -type d -name "file": Find the folder named "file" in the current directory, only display the folder
- ls -a: List all files and folders in the current directory, including hidden files
- ls -at: Sort files by creation time
- ls -alh: Sort by file size
- ls -ah: Sort by file name indentation
- cd ..: Return to the previous directory
- cd /: Return to the root directory
- mkdir -p /path/to/new/folder: Create a multi-level folder
This article is for reference only. Please forgive me if there are any deficiencies.