shell 常用命令

2021-08-21 23:58:07 字數 697 閱讀 8087

檔案處理

sed -i "s/jack/tom/g" test.txt  # 替換jack為tom

awk 'nr%4==1' filename #提取檔案4倍數行

sed /^$/d wuhui.txt #刪除空白行

安裝命令

sudo apt-get install pack #可以更換源: /etc/apt/sources.list

sudo gdebi pack.deb #安裝deb軟體

aptitude #自動安裝依賴 可替代apt-get

# python

pip install -i pandas #更換源:~/.config/pip/pip.conf

# index-url =

conda install pandas # 源:~/.condarc

# rinstall.packages(c("cowplot","ggpubr")) #源:~/.rprofile

# options("repos" = c(cran=""))

shell

# 殺死程序

kill -9 id

pgrep -l bwa //根據名字搜尋

pkill bwa //根據名字kill

shell 常用命令

shell 程式設計中使用到得if語句內判斷引數 b 當file存在並且是塊檔案時返回真 c 當file存在並且是字元檔案時返回真 d 當pathname存在並且是乙個目錄時返回真 e 當pathname指定的檔案或目錄存在時返回真 f 當file存在並且是正規檔案時返回真 g 當由pathname...

shell常用命令

1.echo echo 用於輸出,相當於c語言中的printf 用echo輸出變數的值,需要在變數前面加 輸出a的值 a 1echo a shell中變數不需要定義,直接賦值 要用到變數時,需要加 2.管道 命令之間的輸入。將乙個命令的輸出作為另乙個命令的輸入。管道相當於一種過濾功能。3.grep ...

Shell常用命令

shell常用命令總結 1 ls命令 列出檔案 ls la 列出當前目錄下的所有檔案和資料夾 ls a 列出當前目錄下所有以 a字母開頭的檔案 ls l txt 列出當前目錄下所有字尾名為 txt的檔案 2 cp命令 複製 cp a.txt b.txt 把檔案 a的內容複製到b檔案 cp a.txt...