Linux Small Command

Source: Internet
Author: User

View

Cat filename "View inside content, Cate, cat, look like a cat."

More file name "View the file, too many files, one can not see the end, with more to view the next page: space or F next line: Enter Exit : Q or C6>q"

Clear Screen

Clear Command shortcut key ctrl+l

is cls in Windows

Clear a row

CTRL +u command wrong, not a single character deleted

CTRL + C terminate command

CTRL + a cursor to the beginning

Ctrl+e cursor to end of line

Ctrl+k the content after clipping the cursor

Ctrl+y paste Cut content

Command history

History lists all the commands

! ordinal execution History of the first few commands

Press Up ( or downward ) Arrows to turn out history

Input and output redirection

The Shell pre-defines 3 file descriptors for each process

0 Standard input STDIN keyboard

1 standard output STDOUT display

2 standard error output STDERR

Redirect is to change this standard device, input not from the keyboard, output does not display on the monitor

Output redirection

> or >> (echo abc>a echo b>>a append )

Example: echo Hello shows directly to the monitor

Echo Hello>test.txt

Ls-l/tmp>files.txt

More files.txt View file contents

List of files larger than 100M under/WebSite

Find/website-size +204800 >/backup/100m+.file.list

If you do not want to replace the previous content, it is appended, with >>

Output redirection with a lot of, a person to manage dozens of servers, scheduled to save the system state to the file, and then send mail by the administrator

Input REDIRECT ( does not enter content from the keyboard )

Example:Wall </test/msg broadcast from a file read content

In this way, you can use a scheduled task, a year of holiday blessing words written, and then automatically

Date View system time

Date-s "2014-4-11 10:52:23" modified time

Clock View hardware time

Time Synchronization settings:

Clock--SYSTOHC assigns system time to = hardware time (Hardware time and system time)

Clock--hctosys Assign hardware time to = = System time (make system time and hardware time same)

Set system language to English, solve garbled problem

lang= not write anything behind, indicating that using the system defaults, the system is English by default

Input REDIRECT ( does not enter content from the keyboard )

Example:Wall </test/msg broadcast from a file read content

In this way, you can use a scheduled task, a year of holiday blessing words written, and then automatically

Error output redirection

2> or 2>>

Example: Automatic backup usually scheduled tasks are performed automatically in the wee hours of the morning

Cp-r/usr/backup/use 2>>/bak.error

Directing error messages to a file

LS/AAAAAA 2>ls.err if /aaaaa This directory does not exist, save the error message to ls.err

2 in this , that's thefront Shell . Pre-defined 3 file descriptors for each process

Both 0 and 1 can be omitted,and2 cannot be omitted.

Linux Small Command

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.