Bash is the abbreviation of Bourne-Again SHell, is the shell of many Linux platforms, in fact, Bash command has many operating skills, many beginners may not know, master these Skills can get the job done faster, let's learn together.
tab key complement usage
When we tap once on the tab completion command or file name
When we tap twice on the tab lists all the relevant Optional
cd - equivalent to TV look back
Sometimes we enter a very long directory, and then enter another directory, maybe we still go back to the original long, if Know in advance, we may enter pwd, in order to paste in a while, sometimes forget to enter pwd we may have to enter a long path, we can type cd - try, go directly back to the last entry directory, just like It is a look back button when watching TV. Is it very useful?
View 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+.
Usage Examples
First touch a file, then edit this file
touch abcdefghijk
Type vi, then Esc+. Find out if abcdefghijk has appeared after vi\\
Escape character usage
Some commands in the system are alias functions, such as rm, mv, etc. we use, actually rm -i and mv -i.
To view system aliases, use the alias command, such as the default alias for the following system.
[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 will appear, we need one by one Confirm, 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, use the following, delete will not be prompted again.
[root@localhost testdir]# cd dir1
[root@localhost dir1]# ls
file1 file2 file3 file4
[root@localhost dir1 ] # \
m file1 file2 file3 file4
The above is the introduction of the bash command's operation skills. If you want to learn the fine, it is not enough to master the command, but also apply some operational skills flexibly, so that you can get twice the result with half the effort. Have you learnt that?
If the Linux system crashes, the data inside will be lost. Serious damage to the database, learn how
Linux system sometimes has a downtime situation, which is what we call the crash. If the forced rest
vim is a text editor, can be used in Linux systems, for the use of Linux commands can refer to the s
If you need to compare the contents of the system file, then you will use the diff command, you can
How to protect permissions on files under Linux
What should I do if the device id of the Linux virtual machine does not match the drive letter?
Ubuntu install and switch Nvidia dual graphics driver method
How to mount an external device in a Linux system
Ubuntu 12.04 background color can not be changed solution
Linux uses the hadoop dfs command method
Linux svn error Cant convert string from how to do?
How to install and configure DenyHosts tool
How Ubuntu System Uses Script to Upgrade Kernel
How to solve the garbled problem after SecureCRT connects to Linux server
Win7 system excel can not open how to solve?
Teach you to quickly insert a capture screen in Word
Microsoft's 2014: Win10 is still the key
Windows 7 RC version expires today automatically restarts
How to solve the problem of no automatic recovery item in Win8 advanced boot menu
How to remove the Win10 search button, virtual desktop button
Win8 playing World of Warcraft error "BLZPTS00008" how to do?
What should I do if my upgraded win7 computer cannot use HP QC?