1.7-8 aliases, Endpoints

Source: Internet
Author: User

Set alias: Alias command or modify configuration file

Alias command format:

Alias new_command= ' command sequence '

When the alias command is set, the terminal is disabled, and the alias command can be written to the ~/.BASHRC file, and each new shell will read the contents of the ~/.BASHRC file when it is generated.

Usage such as: [[email protected] ~]# alias rm= ' CP [email protected] ~/backup;rm [email protected] ' Copy the file to the user's home directory in the backup directory before deleting it.

To delete an alias:

Unalias command format:

Unalias aliases

or delete the set alias directory directly into the configuration file

If you want to ignore aliases after setting an alias, you can use \ to escape aliases, such as \command, directly using the command itself.

Terminal Information Processing:

Get the number of terminal rows, columns

Tput cols

Tput lines

Get Terminal name

Tput longname

Move cursor to (50,50)

Tput Cup 50 50

Set the terminal background color

Tput setb num where num takes value between 0-7

Set text foreground color

Tput setf num where num takes value between 0-7

Reverse Display

Tput Rev

Set Text style to bold

Tput Bold

Set underline starting and ending

Tput Smul underline to the color is not white text at the automatic disappearance, this is a problem

Tput Rmul

Delete the cursor to the end of the line so the content

Tput Ed

Clear Screen

Tput Clear

Save Cursor position

Tput SC

Restore cursor Position

Tput RC

Cursor is not visible

Tput Civis

Cursor visible

Tput Cnorm

Restore default values

Tput sgr0

Use the following methods:

[[email protected] 123]# echo $ (tput SETAF 2; tput setab 0; tput bold) ' Background color show ' $ (tput sgr0)


Stty command:

Prohibit output capitalization

Stty IUCLC Open

STTY-IUCLC off

Prohibit output lowercase

Stty OLCUC Open

STTY-OLCUC off

Print terminal rows and columns

Stty size

Suppress display

Stty-echo Open Prohibit

Stty echo off disable

Ignore carriage return characters

STTY-IGNCR off Ignore

Stty IGNCR Open Ignore

[Email protected] 123]# stty IUCLC [[email protected] 123]# sldddssd^c [[email protected] 123]# STTY-IUCLC [Email protected] 123]# stty OLCUC [[email protected] 123]# fdlj^c [[email protected] 123]# STTY-OLCUC [[email] Protected] 123]# Dafd^c






This article is from the "Gan mu" blog, please be sure to keep this source http://ganmu.blog.51cto.com/9305511/1846638

1.7-8 aliases, Endpoints

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.