Learn linux Summary (beginner)

Source: Internet
Author: User
Learn the linux Summary (beginner)-General Linux technology-Linux technology and application information. The following is a detailed description. Shut down the system
# Shutdown-h now

Restart the system
# Shutdown-r now
# Reboot

Create an account
# Useradd accountname
# Passwd password
Changing password for user accountname.
New UNIX password:
Retype new UNIX password:
Passwd: all authentication tokens updated successfully.
Modify account attributes
# Usermod accountname
Delete an account
# Userdel accountname
Change to another user
# Su-accountname

Directory structure
/Bin -- usually contains binary (executable) files, which are critical to system usage. It usually also contains basic system programs such as vi (used to edit files), passwd (used to change passwords), and sh (Bourme shelll ).

/Boot -- contains the file used to start the system.

/Etc -- contains system configuration files, such as passwd (Save the user account information and do not confuse it with/bin/passwd ).

/Usr -- can be used for various purposes or by many users. It can contain management commands, shared files, library files, and other files.

File System navigation
Cat -- Concatenate: displays a file;
Cd -- Change directory: Go to the specified directory;
When you use this command independently without parameters, the user will return to his/her home directory;
To go to another directory, you need to take the directory name as a parameter;
Cd/var/adm
Cd ~ The user will be returned to his/her home directory;
Cd .. return to the previous directory of the current directory;

Cp -- Copy: Copy a file/directory to the specified location;
Ls -- List: displays the content of a specified directory;
Pwd -- Print working directory: displays the current directory of the user;

Exit and save the file
: Q! -- Exit vi and do not save the changes. Enter command mode and enter;
: Wq! -- Save the file and exit vi and enter the command mode (entering ZZ has the same function );

Grep command
Global regular expression print (global regular expression printing );

Structure: grep string_to_search_for file_to_search
Grep root/etc /*
The-v parameter allows you to search for all content without a specified string;
Gerp-v root/etc/passwd
It can also be used together with other commands. The output below is the same as that of the command without the-v option;
Cat/etc/passwd | grep root
Gerp commands can be combined with almost any other commands to generate useful output.

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.