Linux Common commands

Source: Internet
Author: User
Tags domain name server name server lookup nslookup

1. nslookup

Do DNS people know nslookup(name server lookup: Domain name Query) command is what to do with the Windows system comes with. But enter nslookupunder Linux, and Show command not found. Direct Yum Install nslookup, error. At this point, you need to find which package provides this command. With Yum provides */nslookup , you can find the software package you need.

If you know the package, you can install it using yum install-y bind-utils .

To query DNS domain name server information:

To query the mail exchanger record:

To query a domain name server:

Querying DNS records:

Query start-Up authority:

Query port number (not found here):

For more information, see: 8 Linux Nslookup Commands to troubleshoot DNS (Domain Name Server)

2. ls

This command is to list directory contents (list directory Contents), which might be a file or a folder.

The "ls-l" (Long listing fashing) command indicates that the contents of the folder are listed in detail mode.

The "ls-a" command lists all the contents of the folder, including "." The hidden file at the beginning.

"ls-l"

3, Md5sum

md5sum is the calculation and verification of MD5 information signatures. MD5 checksum uses matching to verify the integrity of the file.

4, uname

This command is shorthand for UNIX name, showing the details of the machine name, operating system, and kernel.

5. History

This command records the history. It shows the history of all the commands executed in the terminal.

6. Sudo

The "sudo" (Super User Do) command allows authorized users to execute commands from Super Admin users or other users.

Note:sudo allows users to borrow superuser privileges, while the su command actually allows the user to log in as Superuser, so sudo is more secure than su .

"To err are human, but to really foul up everything, you need root password."

"Err can have no, but the root password is really a hopeless." ”

7, Su

You can use this command to switch users, andsu is the abbreviation for switch user. Switching from a normal user to root requires a root password, and switching from the root user to a normal user does not require a password to be entered.

Su Lee says switching to the Lee user.

su means switching to the root user.

8, mkdir

The mkdirmake Directory command creates a new directory under the named path. If the directory already exists, an error message is returned: Cannot create folder, folder already exists.

Note: A directory can only be created if the user has write access to the directory. In Linux, files, folders, drivers, commands, and scripts are treated as files.

9, MKPASSWD

This command generates a hard-to-guess random password based on the specified length. Where-l represents the length. If a 15-bit random password is generated.

10. Date

This command prints the current date and time using the standard output. For more command settings, you can use the date--help command.

11. CP

Copy, this command copies the file from one place to another.

Sometimes with this command directly, the omitting directory prompt appears because there is a directory under Lee_dir and cannot be copied directly. With the CP--help View, there is a parameter to solve this problem. -R (Recursive), copy directories recursively (recursive copy directory).

12. pwd

This command displays the full path of the current working directory at the terminal. The pwd represents print working directory.

13. cd

This command represents a change of directory. It changes the working directory in the terminal to perform copy, move, read, write, etc. such as "CD ~" will change the working directory for the user's home directory, "CD." Represents the parent directory that is switched from the current directory to (the current working directory).

14. Cal

Cal (calender), which is used to display the month in the current month or future, in any year in the past.

15, chmod

The "chmod" command is a pattern bit that changes the file. It changes the file patterns (permissions) of each given file, folder, script, and so on, as required. There are three types of permissions in the file:

Read (r) = 4

Write (W) = 2

Execute (x) = 1

If you only want to give the file read-only permissions, set to "4", write-only permissions, set to "2", only execute permissions, set to "1", read and Write permissions, is 4+2=6, and so on.

Now you need to set up three user and user group permissions. The first is the owner, then the group where the user is located, and finally the other user.

Rwxr-x--x abc.sh

The root privilege here is rwx(Read and write and Execute permissions)

The owning user group permission is r-x(Read and Execute permissions)

Other user rights are- x(only Execute permissions)

In order to change its permissions, for the owner, the user group and other users to provide read, write, execute permissions:

chmod 777 abc.sh

All three types have read and write access:

chmod 666 abc.sh

The owner user has read-write and Execute permissions, and the user's group and other users have only executable permissions:

chmod 711 abc.sh

16, Useradd

Create a user account. After the account is built, then use password to set the password of the account, and can Userdel delete the account. The account created using the USERADD directive is actually saved in the/etc/password text file.

"useradd xiaoliang-p 45678900" Create a user Xiaoliang with a password of 45678900

17, Chown

This command changes the owner of the file and the user group. Each file belongs to one user group and one user. Using the "ls-l" command, you can see something like the following.

The file leo.sh belongs to the user and user group "root", the previous root represents the user, and the latter root represents the user group.

chown lee:root leo.sh To change the leo.sh file to Lee, the user group is root.

18, Ifconfig

This command is used to configure the network interface information for the resident kernel.

19, Netstat

This command displays various network-related information, such as network connections, routing tables, interface statistics, spoofing connections, multicast memberships, and so on.

netstat-a List all network ports

Netstat-at displaying all TCP-related ports

netstat-s Show statistics for all connections

20, uptime

This command is used to query the Linux system load. The average system load is defined to run the average number of processes in the queue during a specific time interval.

If a process meets the following criteria, it will be in the run queue:

    • It is not waiting for the results of the I/O operation
    • It does not actively enter the waiting state (that is, "Wait" is not called)
    • Not stopped (ex: waiting to be terminated)

1, the current time 10:43:18

2, the system has run time 6:45

3, the current online users 1 user

4, the average load 0.00, 0.01, 0.05, respectively, for 1 minutes, 5 minutes, 15 minutes of the system load.

Additionally, this command has a parameter-V (uppercase), which is used to query the version:

21, Wall

This command can send information to all users who log on to the system.

If you send a message to a user who is logged into the system, you can take advantage of the write command.

22. Service

This command controls the start, stop, and restart of the service. This command allows the configuration to take effect, to open, stop, or restart a service without restarting the entire system.

such as service network restart, restart the network card.

23, RM

Remove the command. Can be used to delete files and directories.

Because Mm.txt is created directly with the mkdir command, it is a folder. RM Command cannot delete directory directly, need to add parameter -RF to be able. -R means Recursive,-f represents force.

24. Touch

Create a new file that does not exist or to modify the file timestamp.

Reference:

20 commands that are very useful to Linux experts

20 commands that are useful to intermediate Linux users

20 commands that are very useful for novice Linux

Linux Common commands

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.