終端機中是否有任何功能可以使用捷徑或某種類型的實用程式(整合到終端機中的東西)製作收藏夾命令清單?
答案1
您可以定義別名:
alias l='ls -al'
alias tlc='toolongcommand'
(你可以把它放進你的.bashrc
)
你可能知道製表符補全(如果你從未聽過,我可以想像你為什麼問)。
答案2
我會推薦高速鐵路(以前稱為歷史建議框。HSTR (HiSToRy) 是命令列實用程序,它改進了歷史記錄中的 bash/zsh 命令完成功能。它的目標是使完成功能比 Ctrl-r 更容易、更有效率。
HSTR 還可以管理您的命令歷史記錄(例如,您可以刪除過時的或包含敏感資訊的命令)或為您最喜歡的命令添加書籤。
我特別用它來保存收藏。
安裝
sudo add-apt-repository ppa:ultradvorka/ppa && sudo apt-get update && sudo apt-get install hstr && hstr --show-configuration >> ~/.bashrc && . ~/.bashrc
答案3
答案4
我將投票支持定制我們的終端,讓它了解最常用的命令。這裡是提示:
1.安裝zsh
並設定為預設Shell環境。
# install `zsh`
sudo apt install zsh
# be sure `zsh` is installed successfully
which zsh
# set `zsh` as the default Shell
chsh -s /usr/bin/zsh
2.安裝Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
3.配置zsh
主題(可選)
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
4.添加zsh-autosuggestion
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
安裝完成後,我們應該plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
在 中進行設置~/.zshrc
,然後重新啟動 Shell。
5.安裝Terminator
(選購)
sudo apt install terminator
\o/ 完成!只要嘗試一下,您就會愛上它!
並善待您的up
、down
、left
、right
鍵。