Ubuntu terminal operation and shell commands
1. Ubuntu terminal operation
Open a terminal for command line operations.
Right-click on the Ubuntu desktop to open the terminal compiler.
2. Shell command
1. Directory information viewing command ls
ls -a displays all files and folders, including hidden files, such as those starting with ( . )
2. Directory switching command cd
3. Current path display command pwd
4. System information viewing command uname
5. Clear the screen command clear
Clean up the commands entered above. In fact, the commands have not been deleted, but the above commands have been moved to the top.
6. Display file content command cat
7. Switch user identity command sudo
8. File copy command cp
Copy ac to bc.
9. Switch user command su
10. Move file command mv
Another meaning of this command is renaming.
The following one renames the file.
This is to rename the folder.
The following is to move the ac file to the test1 folder.
11. Create folder command mkdir
12. Create file command touch
Create an ac file.
13. The delete command rm
generally takes -rf directly when deleting.
14. Directory deletion command rmdir
This command can not only delete folders but also delete files.
- List item
When creating a directory, remember to use ls to check whether the directory you created is successful, and you must develop such a programming habit.
15. Display the network configuration information command ifconfig
Use ifconfig to open and close the network card: when you enter ifconfig, some prompt command characters will appear
after it .-h
16. Reboot command reboot
17. Shutdown command poweroff
18. System help command man
19. Synchronously write data to disk command sync
It is often used in embedded systems, which is to store the data to be stored in a buffer, and then automatically write the data to the disk every 10ms.
20.
The most commonly used find file command find is find -name to find the directory where the file name is located.
21. The search content command grep
command grep -nr
grep -nir can be combined accordingly.
22. Folder size view command du
23. Disk space check command df
24. Use gedit to open a certain file.
The command gedit is equivalent to the txt text input box under windows.
25. The current system process view command ps
This command is equivalent to a task manager under windows.
As shown below:
The following is an example of the PS command:
26. View the real-time running status of the process with the command top
View the real-time running status of the CPU.
27. The file type view command file
view is the file type of the file you want.
切记
: Do not switch to root, this will delete the entire system.