天天看點

linux 下如何添加快捷鍵

1 進入使用者的根目錄

 cd   $HOME  或 cd etc (建議在etc下改,這樣無論用哪個使用者登入,都可以使用快捷指令)



 2 然後打開bashrc若不存在則建立bashrc檔案

 vi  bashrc

  

 3 在bashrc頁面最後加上想要加的東西

 alias showlog='cd /opt;tail -f apache-tomcat-client-service/logs/catalina.out;'

 alias showlog200='cd /opt;tail -f apache-tomcat-client-service/logs/catalina.out -n 200;'

 alias showerror='cd /opt;tail -500 apache-tomcat-client-service/logs/catalina.out|grep -A 50 ERROR;'

  

 4 最後執行

 source ~/.bashrc