Linux Commands-System administration

Source: Internet
Author: User
Tags set time disk usage

View current calendar: Cal

The CAL command is used to view the current calendar, and Y displays year-round calendars:

Display or set time: Date

Set the time format (requires Administrator privileges):

date [MMDDhhmm[[CC]YY][.ss]] +format

CC for the year before the two yy years of the last two bits, the first two bits of mm for the month, the latter two bits mm for minutes, DD for the day, HH for the hour, SS for the second. For example: Date 010203042016.55.

Show time format (date ' +%y,%m,%d,%h,%m,%s '):

format Formats meaning
%y,%y Years
%m Month
%d Day
%H When
%M Score of
%s Seconds

View process information: PS

A process is a program with a certain independent function, which is the basic unit of dynamic execution of the operating system.

The PS command can see the details of the process, and the common options (the option can be no "-") are as follows:

Options meaning
-A Show all processes on the terminal, including other users ' processes
-U Show detailed status of the process
-X Show process without control terminal
-W Show widening to show more information
-R Show only running processes

Dynamic Display process: Top

The top command is used to dynamically display the running process. The top command is able to update the display information at a specified time interval after it is run. You can specify a time interval for displaying information updates by adding-D when using the top command.

After the top command executes, you can press the key to sort the displayed results:

Key meaning
M Sort by memory usage
P Sort by CPU Share
T Sort based on the duration of the process run
U The process can be filtered based on the user name entered later
K The process can be killed based on the PID entered later.
Q Exit
H Get help

Terminate process: Kill

The KILL command specifies the process number of a process and needs to be used with PS.

Use format:

The signal value is from 0 to 15, where 9 is absolute termination and can handle processes where the general signal cannot be terminated.

Kill 9,133:9,133 is the process number corresponding to the application

Shutdown restart: Reboot, shutdown, init
Command meaning
Reboot Restarting the operating system
Shutdown–r now Restart the operating system, shutdown will give other users prompt
Shutdown-h now Immediately shuts down, where now is equivalent to a state of 0 time
Shutdown-h 20:25 The system will shut down at 20:25 today.
Shutdown-h +10 The system shuts down automatically after 10 minutes.
Init 0 Shutdown
Init 6 Restart
Detecting disk space: DF

The DF command detects disk space usage and availability for the file system, and can display the usage of all file systems on nodes and disk blocks.

Options meaning
-A Show disk usage for all file systems
-M Display in 1024-byte units
-T Displays disk space usage for each specified file system
-T Display file system

Detecting the disk space occupied by the catalog: Du

The du command is used to count the size of the disk space that the directory or file occupies, and the command performs the same as DF, where du is more focused on disk usage.

The du command is used in the following format: du [options] directory or file name

Options meaning
-A Recursively displays blocks of data in files and subdirectories in the specified directory
-S Displays data blocks occupied by the specified file or directory
-B Display disk usage in bytes
-L Calculates all file sizes and computes multiple times for hard-linked files

To view or configure network card information: ifconfig

If, we just knock: Ifconfig, it will show all the NIC information:

Test remote host Connectivity: Ping

-------------------------------

Source Network

Linux Commands-System administration

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.