bash命令怎么在linux系統(tǒng)中使用

這篇文章將為大家詳細(xì)講解有關(guān)bash命令怎么在linux系統(tǒng)中使用,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關(guān)知識有一定的了解。?
什么是Linux系統(tǒng)Linux是一種免費使用和自由傳播的類UNIX操作系統(tǒng),是一個基于POSIX的多用戶、多任務(wù)、支持多線程和多CPU的操作系統(tǒng),使用Linux能運行主要的Unix工具軟件、應(yīng)用程序和網(wǎng)絡(luò)協(xié)議。?
tab鍵補全用法?
當(dāng)我們敲擊一下tab補全命令或文件名?
當(dāng)我們敲擊兩下tab?列出相關(guān)的所有可選項?
查看以下例子?
[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+.?
用法舉例?
首先touch一個文件,然后編輯這個文件?
touch abcdefghijk?
敲入vi ,然后Esc+.?發(fā)現(xiàn)是不是abcdefghijk已經(jīng)出現(xiàn)在vi后面\?
轉(zhuǎn)義字符用法?
系統(tǒng)中一些命令都是別名的功能,比如我們使用的rm、mv等,實際上是?rm -i和mv -i?。?
查看系統(tǒng)別名可以使用alias命令,例如以下系統(tǒng)默認(rèn)的別名。?
[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'?
有時候我們刪一個文件時候,會出現(xiàn)以下提示,?需要我們一個個確認(rèn),原因就是rm默認(rèn)就是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?
我們可以使用轉(zhuǎn)移字符使別名失效,使用如下,刪除就不會再有提示確認(rèn)了。?
[root@localhost testdir]# cd dir1?
[root@localhost dir1]# ls?
file1 file2 file3 file4?
[root@localhost dir1]# \rm file1 file2 file3 file4?
關(guān)于bash命令怎么在linux系統(tǒng)中使用就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
了解更多網(wǎng)絡(luò)知識關(guān)注:http://www.vecloud.com/