Linux common commands (iv) System administration commands

Source: Internet
Author: User
Tags clear screen set time time and date

4 System Administration commands


Shutdown       graceful shutdown &NBSP

Reboot             Restart computer

PS             &NBSP ;     Show transient process status, view current program execution  ps-aux

Top                 &NBS p; View current program execution scenarios and memory usage, dynamic display currently consumes the most resources process information

Kill                   to terminate a process, You can use the PS or top command to view the ID of the process before killing the process        &NBSP with the kill command;

Date           &NB Sp     Change or view current date

cal                   Show calendar and annual calendar  

Man                 to inquire and explain how a command is used, and the instructions for this command. It's not going to work.   such as: Man ls

Whatis             Find the meaning of a command

Clear Clear Screen

Alias renamed the Command as: Alias showmeit= "Ps-aux", in addition to de-use Unaliax Showmeit

Stat Displays details of the specified file, more detailed than LS. Who shows online login users

WHOAMI Show current Operation user

Hostname Display host name

Uname Display System Information


4.1 Shutdown command

To use this command, the root user must be guaranteed, otherwise the SU command will be used to change to the root user.

The command format is as follows: shutdown– (option)

-K is not a real shutdown, just a warning command

-R Restart after shutdown

-T shuts down within the specified time

To shut down within 2min, enter the command: Shutdown–t 2

If it is restarted after shutdown, enter the command: shutdown–r


4.2 reboot Command

This command is also a shutdown command, only input, without any parameters, the system will be the fastest speed shutdown, and do not write memory or buffer contents back to the hard disk.

-D does not write the record in the/var/log/wtmp file (-n This parameter contains-D)

-F Force Re-boot, do not call shutdown this command

-N Do not write the memory data back to the hard drive before rebooting

-W doesn't really reboot, just writes the records to the/var/log/wtmp file.


4.3 ps command

The PS command is used to see what programs are in progress in the computer system and how they are executed. This is a fairly powerful command that can be used to find out all the process IDs and names.

In addition, the PS command can be used to list all programs that use memory.

Use the following:

PS – (option)

-l list in long format

-U lists the name and usage time of the user

-m lists memory distribution scenarios

-R lists only the foreground programs that are being executed and does not list additional information

-x lists all programs, including those that do not have a terminal


4.4 Top Command

The top command can view the current program's execution scenarios and memory usage.

It is similar to PS, however, it updates the system state for a few seconds and is easy to track.

To get out of this program, press CTRL + C key to do it. 1 You can expand the view CPU.


4.5 kill command

The KILL command is used to terminate a process that is executing. If a program fails during execution, you can terminate the program to avoid remaining in memory and consuming system resources.

However, its practical significance is to send a signal to the executing program, calling it suicide. Can send a lot of signals to these programs, also can let them receive signal after doing a lot of things.

Standard usage: kill– (option) PID before executing the KILL command. You can use the PS command to check the PID of a program that is down, and then remove a program by using kill.

For example, a program that terminates PID 90: Kill 90

-l list all available signal names

-P print out PID does not send signal

-signal the available signals are HUP (1), KILL (9), term (15), respectively, representing the re-run, cut off, end

Cut off the PID 323 stroke (Kill): Kill-9 323

Re-run the PID 456 stroke (restart): Kill-hup 456

4.6 Date command sudo dpkg-reconfigure tzdata

The date command is used to display, set, and modify the current time and date.

Standard usage: date– (option) Display time format (beginning with +, followed by format) date set time format

-U use GMT

-R The last time the file was modified

-S set time

Several commonly used time formats are shown in the following table:

%a of the week, such as the full name of one, two or three%a weeks, for example, Monday, Tuesday

%d Date (mm/dd/yy format)

%T display time format, 24-hour (HH:MM:SS)

%x format for displaying dates (MM/DD/YY)

The last two digits of the%y year

%Y year (e.g. 2007, 2008)

%r time (Hh:mm:ss morning or afternoon)

%p Show morning or afternoon

If you enter a command: the date "+%x,%r" system returns the following information: May 10, 2016, 17:36 P.M. 26 seconds

4.7 cal Command

The CAL command has two functions: a monthly calendar and a calendar.

The direct Input CAL command displays a monthly calendar for the current month. To display a year's annual calendar, you can add a 4-digit year of A.D. to the Cal command.

For example, to display a 2008 year calendar, you must enter: Cal 2008

If you enter Cal 08, the Year 8 calendar is most displayed.

To view only a January calendar for a given year, you can enter: Cal month AD year. For example, enter: "Cal 12 2004".


4.8 Man Command

The man command is used to query and interpret the use of a command and the considerations for this command. This query query is available on every Linux.

Typically, the user simply enters the command man and the name of the command shell will list a complete description.

Standard usage:

Name of the man command

To query the description page of the LS command, enter the command: Man ls

To flip through the manual page, you can use the page UP and PAGE DOWN keys, or use the spacebar to turn back one page and use B to flip forward. To exit the manual page, enter the command Q. To search for keywords in the manuals page, enter a command/and keyword or phrase to search for, and then press ENTER. All keywords appearing on the manuals page are highlighted, allowing you to quickly read the keywords in the context.


4.9 whatis command

The Whatis command is used to query the meaning of a command. The use of simple, and do not need any parameters, directly after the Whatis command to add the command to query can be, but it is very practical.

To query the meaning of the MV command, enter the command: Whatis MV


Linux common commands (iv) System administration 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.