[指令] Command Line 操作
keywords: zsh
, iterm2
, terminal
, linux
, unix
open -a [appToOpen] [fileName] # 指定特定應用程式開啟檔案
tail -f [filename] # 從結尾開始讀檔,並且持續監控變化
Linux Terminal Command Reference @ linux community
變數
$PATH
所有能夠在 Terminal 中直接被執行的程式,都需要放在 $PATH
內,否則需要先指定到該程式所在的資料夾後才能執行。
echo $PATH
如果想要將其他路徑添加到 $PATH
中,可以在 .bash_profile
或 .zshrc
中使用:
- 在
PATH=""
後面使用$PATH
是為了把原本已有的PATH
保留下來,否則會覆蓋掉。 - 用
:
當作不同路徑的區隔
# .zshrc
export PATH="$PATH:~/my-scrips"
$SHELL / $0
當前 Terminal 使用的 shell:
echo $SHELL # /opt/homebrew/bin/zsh
echo $0 # -zsh