Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sharing some operating skills of bash commands in lixux system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is mainly about "sharing some operating skills of bash commands in lixux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "some operating skills sharing of bash commands in lixux system".

Complete usage of tab key

When we click on the tab completion command or file name

When we double-click tab to list all the relevant options

Cd-the equivalent of watching TV

Sometimes we enter a very long directory, and then enter another directory, maybe we can go back to the original long, if we know in advance, we may enter pwd, so that we can paste for a while, sometimes we forget to enter pwd, we may have to enter a long path, we can type cd-try, go directly to the directory we entered last time, like watching TV when the look back button. Isn't it easy to use?

Check out the following example

[root@localhost /] # cd / tmp

[root@localhost tmp] # pwd

/ tmp

[root@localhost tmp] # cd /

[root@localhost /] # pwd

/

[root@localhost /] # cd-

/ tmp

[root@localhost tmp] # pwd

/ tmp

Esc+.

Examples of usage

First touch a file, then edit the file

Touch abcdefghijk

Type vi, and then Esc+. Find out if abcdefghijk has appeared behind vi.

Escape character usage

Some commands in the system are alias functions, such as rm, mv, etc., which are actually rm-I and mv-I.

You can use the alias command to view system aliases, such as the following system default aliases.

[root@localhost 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 it one by one. The reason is that rm defaults to rm-I.

[root@localhost testdir] # cd dir1

[root@localhost dir1] # ls

File1 file2 file3 file4

[root@localhost 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

We can use the transfer character to invalidate the alias, using the following, the deletion will no longer be prompted to confirm.

[root@localhost testdir] # cd dir1

[root@localhost dir1] # ls

File1 file2 file3 file4

[root@localhost dir1] #\ rm file1 file2 file3 file4

At this point, I believe you have a deeper understanding of "sharing some operating skills of bash commands in the lixux system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report