--- title: Linux 常用操作指令 --- # Linux 常用操作指令 ###### tags: `系統設定` ## 系統: 查看最大目錄前十個 - 含隱藏檔 >sudo du -B G | sort -rh | head -10 ## 壓縮: 壓縮 >tar -cfr ## 解壓縮: >tar -xvf ## nohup 暫存語句: > nohup ./app-api >logs/app-api.nohup 2>&1 & ## 刪除本次操作記錄: > history -c ## 內文搜索 > grep -nr test > n:顯示行數; r:包含子資料夾 ## 檔案內的量 >wc test.txt >grep -nr test | wc -l或--lines 显示行数; -w或--words 只显示字数; -c或--bytes或--chars 只显示Bytes数; https://www.runoob.com/linux/linux-comm-wc. ## 查看對外ip ``` curl ifconfig.me ``` ## 遠端機器的檔案上傳下載 上傳rz, 下載sz https://cloud.tencent.com/developer/article/1834587 ## SED 替換文件中文字: sed -i "s/替換前/替換後/g" aa.txt 有特殊符號要加上 \\ 做轉譯 ## 排程刪除程序 ``` ps -ef | grep nats | grep -v grep | awk '{print $2}' | xargs kill -9 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up