- 縮短command line 裡面的路徑(terminal instance)
本來的路徑長相
usr@ubunt:~/Downloads/Cython/Delta_person_detection/faster-rcnn$
執行 PS1='\u@\h:\W\$ '
會變成
usr@ubuntu:faster-rcnn$To change it "permanently" (永遠改成這種形式)
In your~/.bashrc, find the following section:if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ ' fi - vi 裡面要刪除整行的指令:dd
用檔名找檔案 find . -name "*prototxt" -print
2015年12月10日 星期四
Linux command line 指令
2015年12月7日 星期一
將console message導入文件 跟 2>&1
如果想將程式執行的訊息輸出到文件檔
ex: ./tools/demo.py > output.txt 2>&1
./tools/demo.py
執行程式
> output.txt
將console message 輸出到 output.txt
2>&1
改變file descriptor
***
「>」的意思其實是,將「>」左邊輸出的東西重新導向到右邊去。
但不止是這樣而已,系統將標準輸入輸出分成三個:標準輸入 (stdin)、標準輸出 (stdout)、以及標準錯誤輸出 (stderr),它們的 fd (file descriptor, 檔案描述子) 分別是 0、1、2。
當「>」左邊未指定任何東西時,它會讀取左方程式的標準輸出 (也就是 fd=1) 重新導向給右邊的東西,但是你也可以指定要重新導向的 fd (也就是說「>abc.txt」會等於「1>abc.txt」)。所以可以想見 2>&1 的意思應該是把 fd=2,也就是標準錯誤輸出重新導向給 &1。而這邊的 &1 指的其實就是 fd=1。
訂閱:
文章 (Atom)