linux下的基本命令

來源:互聯網
上載者:User

尋找目錄下的哪些檔案中含有某個字串 

find .|xargs grep -ri "IBM" 

尋找目錄下的所有檔案中是否含有某個字串,並且只列印出檔案名稱 

find .|xargs grep -ri "p3_40_16_16/畢業" -l 

grep -lr '畢業賣馬鈴薯去-酷褲頭.mp3' /scmgt/logs/*  

尋找指定檔案中是否有某個字串【| less 管道  點擊斷行符號慢慢查看】
cat pdtSrv_error.log | grep 12345676543221 | less   

尋找檔案所在目錄
find / -name productServer.jar
find / -name 2z80sf31d77628523251.mp3

查看行數

cat countTimeLogger.log  | wc -l

查看檔案及時更新

tail -f xx.log

本地上傳的sh指令碼到伺服器上運行需要編碼,否則不能夠運行
vi xx.sh
set fileformat=unix

查看進程
ps -el|grep java 
ps -ef|grep java 
kill -9 xxx
kill -9 `ps -ef|grep "ChTFtpMusicFileServiceImpl"|grep -v grep|awk '{print $2}'`  
kill -9 `ps -ef|grep "FtpWalkmanMain.sh"|grep -v grep|awk '{print $2}'`  
kill -9 `ps -ef|grep "FtpColoringMain.sh"|grep -v grep|awk '{print $2}'`  

壓縮gz
unzip sucai_0407.dmp.gz
壓縮:
gzip sucai_0407.dmp.gz

上傳(2個伺服器之間對傳檔案,速度超級快)
scp sucai_0407.dmp 10.25.173.31:/scmgt/

執行定時任務
crontab -e 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.