Linux Beginners-Common basic command articles

Source: Internet
Author: User
Tags parent directory

There are many commands in the Linux system, and it is possible for the software to bring commands, it is difficult to understand all these commands, but there are some basic commands that are widely used in the normal study work. The following is a brief introduction to the common commands in several Linux systems.

1, man

The "Man" command is a help command under Linux, with the help of commands that can be viewed through the "man" command, configuration file Help, and programming help. For example, to see the introduction and usage of the "passwd" command, you can enter "man date" at the command line to see the introduction and parameter usage information for the "date" command.

The "Man" command is a widely used and very powerful command in Linux. The "man" command also has several levels, such as "Man 1 passwd" is the command Help to view passwd, usually 1 can be omitted. "Man 5 passwd" is the Help to view passwd configuration files. More usage can also be viewed through the "Man Man" command.

The "man" command can be viewed with a shortcut, such as "Up or down" on one line, "Pageup|pagedown" down a screen or to the previous screen, "D|u" down or up half the screen, "G|gg" jumps to the bottom or top of man, "/keyword" Search keywords, keywords will be highlighted, n to match, n up, "Q" Exit help.

The command parameters described below are not fully described and can be viewed by the "man" command for complete information.

2, passwd

The "passwd" command is a command used to modify the user's password, which is an important safeguard for the user's security. You can modify the current user's password by entering passwd directly on the command line, as shown in.

Note that the superuser changes the password without any restrictions, do not need the original password, but the ordinary user needs to enter the original password, and the length of the password can not be less than eight bits, not pure numbers or pure letters, and not similar to the original password, "student" is an ordinary user.

Super users can modify the password of the ordinary user through "passwd uesrname" and do not need the original password, there is no limit to the password, if you need to modify the "student" user's password, you can enter the "passwd student" command, enter two times the new password can be modified successfully.

"passwd" command can also add parameters, such as under the Superuser, "passwd-r student" can view the user student password information, when, add the parameter "-L" can lock the user, add the parameter "-u" unlock, "-N" can set the minimum validity period of the user password , "-X" can set the maximum validity period and so on. More parameters can be viewed through the command help.

3. Date

The "date" command looks at the system time, "date-d +xday" and "date-d-xday" to see the X days and the time before the X day. To see the time 6 days ago and 6 days later.

The Superuser can modify the system time through "date MMDDHHMM[YY][.SS", for example, if the system time needs to be set to September 15, 2008 13:14 8 seconds, you need to enter "date 091513142008.08".

4. File

The "file" command is used to view the file type, such as viewing the type of "/etc/passwd" file, and entering the command "FILE/ETC/PASSWD", you can see that "/etc/passwd" is a plain text file.

5, Cat,less,head,tail

"Cat", "less", "head", "tail" commands are used to view files. "Cat" is used for the entire contents of the file, "less" for paging through the file, "Head-n X" can view the file before the X-line content, "Tail-n x" View the file after the X-line content.

6. WC

"WC" is a command that statistics file capacity information. For example, "Wc-l/etc/passwd" counts the number of rows for "passwd" files, "Wc-c/etc/passwd" counts the bytes of "passwd" files, "-W" is the count of words, "-M" counts the number of characters.

7. pwd

The "pwd" command allows you to view the current directory.

8. cd

"CD" is a command to switch the working directory. "CD directory" can switch to the specified directory, such as switch to, directory "/etc". "CD-" can switch to the previous directory. "CD ~" can switch to your home directory. "CD ~username" can switch to the home directory of the specified user. "CD.." You can enter the parent directory of the current directory.

9, LS

The "LS" command can list information about a directory or a file. If there is no target behind "LS" then the current directory is assumed to be the default. "LS" after adding a directory or file, such as "LS Test" is listed in the test directory content. The parameter "-D" indicates that the directory itself is listed. The parameter "-L" indicates the property that lists the contents of the directory or file. The parameter "-ld" lists the properties of the directory itself. The parameter "-a" displays all content in the directory, including "." The hidden file at the beginning. The parameter "-R" indicates that the contents of the directory are displayed recursively.

These are just a few of the common commands, there are many Linux systems, such as file creation, deletion, movement and other commands, these commands in the next chapter in the sorting.

Linux Beginners-Common basic command articles

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.