Linux basic commands

Source: Internet
Author: User
Tags aliases echo command

First, shutdown, restart

1. Turn off the machine

Shutdown option [option] ... Parameter (time) option:-R: Restart-H: Shutdown-C: Cancel the previously set restart or shutdown command-K: Send only reminder time format: default equivalent to +1hh:mm now: immediately +#: #分钟之后

2. Restart

Reboot #重启 Poweroff #直接断电拉闸


Second, time management

Date #显示当前系统时间 Date MMDDHHMM[CC]YY.SS: Set system time Date [+format]: Specify time format%Y: Year%m: Month%d: day %H: Hours%M: minutes%s: Seconds%A: Days of the week%F: year-month-day%T: When: minutes: seconds Hwclock: Show current hardware time-s,--hctosys Hardware time, calibration system time-W,--SYSTOHC to the system time, correct hardware time

Third, command aliases

Alias: Define command alias Example: Alias rm= ' Rm-i ' unalias: Undo Alias-A cancels all aliases example: Unalias RM PS: alias defined on the command line, only valid for the current shell process to be permanently valid, define the configuration file : Only for the current user: ~/.BASHRC valid for all users:/ETC/BASHRC

Iv. Command History

History: View executed commands historical!n: Execute the nth command in the past!! : Executes the previous command!-n: Executes the reciprocal nth command!$: Last parameter in the last command-D N: Delete nth command history-C: Clears the historical list

V. Echo command

Echo:echo will send the input string to standard output. Usage: echo [option] [string] option:-N: Do not wrap-e: enable \ Character interpretation function "" "(double quotes): Weak reference, variable will replace ' (single quote): Strong reference, variable will not replace (all treated as String) ' (Inverse Number): Command reference font color: # echo-e "\033[5;43;31mabc\033[0m" # echo-e "\033[display mode (optional); font background color m string \033[0m"


Linux basic commands

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.