Linux Commands---echo, wall, write, clear, sync, uptime commands

Source: Internet
Author: User
Tags clear screen

EHCO command: Display a line of text

"Feature" will print out the content by default, which is most commonly used in the shell.

Syntax

echo option argument

"Common options"-E activates escape characters

\b: Delete the previous character \c: End with a newline symbol \ n: newline and the cursor moves only the beginning of the line \ r: The cursor moves to the beginning of the line, but does not wrap \ t: Insert tab\\: Insert "\" character

Instance

Print the given string directly [[email protected] tmp]# echo  "Hello word" hello word//add-e option to activate escape character "\ N "[[email protected] tmp]# echo -e " Hello\nword " helloword//Delete the previous character to add the" \b "escape character [[ email protected] tmp]# echo -e  "Hel\blo\nword" heloword//add newline "\ n" and tab means "\ t" [email  protected] tmp]# echo -e  "A\TB\TC\T\ND\TE\TF"  a        b       cd       e        f//Displays the shell environment where the current user is logged on [[Email protected] ~]# echo $0-bash View the previous command execution result status [[email protected] ~]# echo $?0//View the current user's home directory path [[email protected] ~ ]# echo  $HOME/root//Displays the SHELL environment and path [[email protected] ~]# echo  the current user is logged on $SHELL/bin/ bash//But the usual is echo a string to the file,[[email protected] ~]# echo  "www.baidu.com"  > /tmp/ B.txt | cat&nBsp;/tmp/b.txt 


Wall command: Send a message to everybody ' s terminal

"Feature" sends information to each end user

Syntax

Wall ' message '

"Instance" sends content "message" content to all user terminals, including itself, but requires online users

[Email protected] ~]# wall ' message ' [[email protected] ~]# broadcast message from [email protected] (PTS/2) (Fri Apr 22 0 5:44:54): Message

Write command: Send a message to another user

"Feature" sends information to other users,

Syntax

write [users] [TTY]

When you enter the Write users tty# enter the input mode, enter the content you need to enter, and then return to send information to each other, the other party can receive information.


Clear Command: Clear the terminal screen

"Function" clear terminal screen information, referred to as clear screen, shortcut key ctrl+l can be used to indicate the command line input.

Syntax

Clear or Ctrl+l

This command is available when there is too much content on the screen and needs to be re-cleaned, but it is not really clear, it is just the equivalent of a non-informational screen.


Sync Command: Flush file system buffers

"Feature" refreshes the file system's buffers, that is, writes the buffer's files to the hard disk

Syntax

Sync


Uptime Command: Tell how long the system has been running

"Features" show how long the system has been running so far, can see the information is: the current time, the system has been running for a long time, the user is currently logged into the system, the system in the past 1 minutes, 5 minutes, 15 minutes of the average load balance.

Syntax

Uptime

Instance

Add-V option displays version information [[email protected] ~]# UPTIME-VPROCPS version 3.2.8//default command using [[email protected] ~]# uptime 06:10:47 up 5:43 , 3 users, load average:0.01, 0.01, 0.00


This article is from the "Perthon" blog, make sure to keep this source http://perthon.blog.51cto.com/10484057/1766431

Linux Commands---echo, wall, write, clear, sync, uptime 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.