Some operation skills under bash commands in lixux System

Source: Internet
Author: User

Bash is the default shell in Linux. Bash has many things, including variable setting and usage, bash environment creation, and data stream redirection. It has some shell operation skills, in the future work, you can get twice the result with half the effort. If you need a friend, you can refer to and learn more.Linux video tutorial.

650) This. width = 650; "src =" http: // 183.61.143.148/group1/m00/02/48/tz2plfq4zzzgnylzaacb6aeracs660.jpg "style =" border: 0px; "/>

Use of tab key completion

When we press tab to complete the command or file name

When we press the tab twice to list all the related options

CD-similar to TV playback

Sometimes we enter a very long directory and then another directory. Maybe we can go back to the original long directory. If we know it in advance, we may enter PWD to paste it later, sometimes we forget to enter PWD. We may have to enter a long path. We can enter CD-try and directly go back to the last directory, just like the playback button when watching TV. Is it easy to use?

View the following example

[[Email protected]/] # cd/tmp

[[Email protected] TMP] # pwd

/Tmp

[[Email protected] TMP] # cd/

[[Email protected]/] # pwd

/

[[Email protected]/] # cd-

/Tmp

[[Email protected] TMP] # pwd

/Tmp

ESC +.

Example

Touch a file first, and then edit the file

Touch abcdefghijk

Input VI, and then ESC +. Check if abcdefghijk is already behind Vi \

Escape Character usage

Some commands in the system are alias functions, such as RM and MV, which are actually Rm-I and MV-I.

You can use the alias command to view the system alias, for example, the default alias of the following system.

[[Email protected] testdir] # Alias

Alias CP = 'cp-I'

Alias egrep = 'egrep -- color = auto'

Alias fgrep = 'fgrep -- color = auto'

Alias grep = 'grep -- color = auto'

Alias L. = 'LS-D. * -- color = auto'

Alias LL = 'LS-l -- color = auto'

Alias ls = 'ls -- color = auto'

Alias mv = 'mv-I'

Alias Rm = 'rm-I'

Alias which = 'Alias |/usr/bin/which -- tty-only -- read-alias -- show-dot -- show-tilde'

Sometimes, when we delete a file, the following prompt appears, which requires us to confirm one by one, because RM serves as RM-I by default.

[[Email protected] testdir] # cd dir1

[[Email protected] dir1] # ls

File1 file2 file3 file4

[[Email protected] dir1] # rm file1 file2 file3 file4rm: Remove regular empty file ?. Ile1 ?. Y

RM: Remove regular empty file ?. Ile2 ?. Y

RM: Remove regular empty file ?. Ile3 ?. Y

RM: Remove regular empty file ?. Ile4 ?. Y
You can use the transfer character to invalidate the alias. If you use the following code to delete the alias, no confirmation is prompted.

[[Email protected] testdir] # cd dir1

[[Email protected] dir1] # ls

File1 file2 file3 file4

[[Email protected] dir1] # \ RM file1 file2 file3 file4

For more information, see E liangshi Yiyou Network .

Some operation skills under bash commands in lixux System

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.