Linux/centos Basic Operation

Source: Internet
Author: User
Tags save file



File directory


    1. USR: related to software Installation
    2. VAR: system Run Process related
    3. Bin: Executable file
    4. Boot: System Boot related directory
    5. Dev: Drive Directory
    6. Home: Store user's individual user files
    7. Lib:linux function Library
    8. Media: can delete devices
    9. MNT: Media-like
    10. OPT: third-party software storage Directory
    11. Root: Administrator Directory
    12. Sbin: Administrator executable file
    13. Temp: Temporary files that need to be deleted periodically
    14. Proc: Virtual File system
    15. SYS: Virtual file system, kernel module
    16. ETC: Store the user group file "group", User information file ' passwd


Common commands


  1. View Ip: ip Addr

  2. View information ls

  3. View more information ll or ls-l

  4. View hidden files Ls-al

  5. Create a folder (you can fill in the path, but the path must exist) mkdir <name>

  6. Create file (path does not exist, create path automatically) Mkdir-p <name>

  7. Safe deletion (only empty directories can be deleted or error) RmDir <name>

  8. Delete Rm-rf <name>

  9. Create File VI <name>

  10. Save File Press ESC, enter: q / exit or wq / Save and exit

  11. Edit press I--press ESC--q! / Force quit or wq / save and exit

  12. The arrow keys in the file h / left, k /, j /, l / right

  13. Fast Move cursor number key + arrow key

  14. Page DOWN Ctrl + f

  15. Page UP Ctrl + b

  16. Turn up half a page ctrl + u

  17. Turn down half a page ctrl + d

  18. Move to end of line end or $

  19. Move to the wardrobe home or 0

  20. Move to the end of Wen Shift + g

  21. Move to the beginning G + g

  22. How many rows of numbers to move backwards + shift + g

  23. Querying the command line / + query criteria

  24. Query up the command line? + Query criteria

  25. Delete Files Rm-f <name>

  26. 10 lines after viewing the file tail <name>

  27. 20 lines after viewing the file tail-20 <name>

  28. Float, change the contents of the file, print out the changes tail-f <name>

  29. Print file contents Cat <name>

  30. filtering, finding grep <name>

  31. ll | grep txt file in ‘txt’ folder




User actions


    1. User must belong to a user group, you add a user, the system will automatically help you create a user group
    2. Add user Information Useradd <name>
    3. Print user Information cat/etc/passwd


Printed information cc:x: 1000:1000::/home/cc:/bin/bash



Directory for user name, password, user ID, user group ID, notes, user directory, Shell command, respectively



4. Add a password to the user passwd <name>



5. Remotely connect a computer SSH < user name >@ address



6. View user Groups Cat/etc/group



7. Create user group Groupadd < user group name >



8. Add user to User group Useradd-g < user group > < user name >



9. Delete user groups Groupdel < user groups >



However, the user primary group cannot be deleted, the user primary group is a user group with the same name as the user name, you can change



10. Delete User Userdel < user name >



11. See which user group the user belongs to, group < user name >



Direct write group, is to view the current user group



12. Modify user Primary group Usermod-g < user group > < user name >



13. View the user's details ID < user name >



14. Switch User Su < username >



15. Exit the user exit



Background operation


    1. View Machine Type Lscpu
    2. View disk full space DF
    3. View disk space df-h
    4. View index Space Df-i
    5. View current running program PS aux
    6. To see if the program is running PS aux |grep < user name >
    7. View top of a computer's resource footprint
    8. Exit Ctrl C
    9. If you cannot connect to the server, you need to turn off the firewall


Systemctl Disable FIREWALLD



Reboot



All interfaces on Linux are in the form of files






Linux/centos Basic Operation


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.