Here are some basic Linux commands that are essential for beginners:
1. File System Commands:
- ls: Lists files and directories in the current directory. Example: ls -l lists files in long format.
- cd: Changes directory. Example: cd /path/to/directory changes the current directory to the specified path.
- pwd: Prints the current working directory, showing the full path of the current directory.
- mkdir: Creates a new directory. Example: mkdir my_directory creates a directory named "my_directory".
- rmdir: Removes an empty directory. Example: rmdir my_directory deletes the directory "my_directory".
- rm: Removes files or directories. Example: rm file.txt deletes the file "file.txt".
2. File Manipulation Commands:
- cp: Copies files or directories. Example: cp file1.txt file2.txt copies "file1.txt" to "file2.txt".
- mv: Moves or renames files or directories. Example: mv old_file new_file renames "old_file" to "new_file".
- touch: Creates an empty file or updates the timestamp of an existing file. Example: touch new_file.txt creates a new empty file.
- cat: Concatenates and displays file content. Example: cat file.txt displays the content of "file.txt".
3. Viewing Files and Directories:
- less or more: Allows viewing file content page by page. Example: less file.txt or more file.txt.
- head: Displays the beginning of a file. Example: head file.txt displays the first few lines of "file.txt".
- tail: Displays the end of a file. Example: tail file.txt displays the last few lines of "file.txt".
4. Working with Text Files:
- grep: Searches for patterns in files. Example: grep pattern file.txt searches for "pattern" in "file.txt".
- wc: Counts lines, words, and characters in a file. Example: wc file.txt.
- sort: Sorts lines of text files. Example: sort file.txt sorts the lines of "file.txt".
5. Process Management Commands:
- ps: Displays information about active processes. Example: ps aux shows all running processes.
- kill: Terminates processes. Example: kill process_id stops the process with the specified ID.
6. System Information Commands:
- uname: Prints system information. Example: uname -a displays all system information.
- uptime: Shows system uptime, indicating how long the system has been running.
- free: Displays the amount of free and used memory in the system.
7. Network Commands:
- ping: Tests network connection to a server. Example: ping example.com checks if "example.com" is reachable.
- ifconfig or ip: Configures network interfaces. Example: ifconfig or ip addr show displays network information.
- netstat: Prints network connections, routing tables, interface statistics, etc. Example: netstat -tuln displays listening ports.
8. Getting Help:
- man: Displays manual pages for commands. Example: man command_name provides detailed information about a command.
These basic Linux commands provide essential functionalities for navigating the file system, managing files, viewing file content, working with text files, managing processes, retrieving system information, working with networks, and accessing command documentation.