Basic commands under Centos system

1. Get the IP address
windows: ipconfig
linux: ifconfig
2. Enter the folder
cd folder path
3. Restart
4. View the directory structure
ll Query the folder
ll -a View all files
ls
dir
5. View the current path
pwd
6. Clear the control Station
clear
7. Change password
passwd
8. User root path
~
9. Text editing tool
vim
:q Exit
:w Save
:wq Save and exit
:q! Force quit
i Enter edit mode
esc Exit edit mode
10. Environment variables
User environment variables File:
~/.bash_profile
System Environment Variables:
/etc/profile
11. Output
echo $PATH
12. Output to file
echo helloworld > /var/www/html/a.txt
13. Get the file content
cat /var/www/html/a.txt
14. Shutdown
shutdown -h now
init 0
15. Restart
shutdown -r now
reboot
16. Logout
logout
exit
17. init command
init 0 shutdown
init 3 text mode
init 5 window mode
18. create a folder
mkdir folder name create only one level
mkdir -p folder name create a directory tree
19. delete a file or folder
rm file name
rm - rf recursively force delete
20. copy file or folder
cp filename
cp -R filename copy recursively
21. move/cut
mv source path destination path
22. create
echo content > file path
touch file path
vim file path

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326955595&siteId=291194637