Linux commands detailed parsing (1)

Source: Internet
Author: User
Tags disk usage

 One, command prompt

Typically the shell command prompt takes the form of:

[Email protected]:d irection$

Username: User name, showing current user's account

Hosname: hostname, such as Telnet, is the host name of the login

Direction: directory name, which shows the current path, when the "/" is displayed in the root directory, when the "~" is displayed in the user's home directory.

For example: [[email protected] home]#, username is root, hostname master,home is directory name.

  Second, the command format

A command contains 3 features: command name, options, parameters. The command name is required, and options and parameters are optional. The command format is as follows:

$ Command [-options] Argment1 Argment2

$ for prompt if the current user is the Roo super User prompt # If it is a normal user prompt. For example: Super user [[email protected] home]#, common name [[email protected]/]$.

  Third, user system-related commands

1. User Switch command

Su-root

For example:   

[Email protected]/]$ Su-root
Password:
[Email protected] ~]#

Role: To switch other users to root, enter a password, it is recommended that the "-" band, you can bring the root environment variables and working directory at the same time, otherwise, due to the problem of environment variables error.

2. System Management Commands (PS and kill)

PS: Displays a list of processes that the user is running on the current system.

Kill: outputs a specific signal to the specified PID (process number) and behaves as specified after the signal has been completed. The possible signals are process hangs, process waits, process termination, and so on.

Format:

PS [options] kill [option] process number (PID)

Typically use Ps-ef |grep java to find Java processes

Kill-9 PID kills a process

3. Disk-related commands

Linux common system Administration commands

Options Command meaning Format
Free To view current system memory usage free[Options]
Du The size of the disk space occupied by the statistics directory (or file) du[Options]
Df View disk usage on the file system df[Options]
Fdisk View disk partitions and partition management of hard disks FDISK[-L]


You must have root permission to use Fdisk-l.

1[Email protected] home]# fdisk-L2 3Disk/dev/sda:10.7 GB, 10737418240 bytes, 20971520a Sector4Units = Sector of 1 * 512 = 512bytes5Sector size (logical/Physical): 512 Bytes/512bytes6I/o size (min/best): 512 Bytes/512bytes7 disk label type: DOS8Disk identifier: 0X0003D0AD9 Ten device Boot Start End Blocks Id System One/DEV/SDA1 * 2048 2099199 1048576 83Linux A/dev/sda2 2099200 20971519 94361608e Linux LVM -  -Disk/dev/mapper/cl-root:8585 MB, 8585740288 bytes, 16769024a Sector theUnits = Sector of 1 * 512 = 512bytes -Sector size (logical/Physical): 512 Bytes/512bytes -I/o size (min/best): 512 Bytes/512bytes -  +  -Disk/dev/mapper/cl-swap:1073 MB, 1073741824 bytes, 2097152a Sector +Units = Sector of 1 * 512 = 512bytes ASector size (logical/Physical): 512 Bytes/512bytes atI/o size (min/best): 512 Bytes/512 bytes

4. Disk hangs on command (Mount)

Role: Using the Mount command, you can mount the file system to the appropriate directory, and because Linux uses the device as a file, the Mount command can mount different devices.

Format: Mount [options] [type] device file name mount point directory.

Linux commands detailed parsing (1)

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.