Linux 實用命令整理強大

2021-10-22 07:35:13 字數 722 閱讀 4074

簡單的就不說了

[查詢某個檔案]

find . -name "***"

***是檔名稱,注意中間的空格, 「.」表示當前資料夾下包括所有子資料夾下

如果是指定資料夾下,則寫完整即可,

find /opt/tmp/ -name "***"

如果是當前資料夾下的某個資料夾下

find ./tmp/ -name "***"

[查詢檔案裡是否包含某個字串]

grep . -rn "***"

***是 要找的內容,注意中間的空格, 「.」表示當前資料夾下包括所有子資料夾下

也可以使用:grep . -rn ***

也可以使用 grep -nrw "***"

很神奇這樣都可以

如果***中間有空格,例如「unable to deter」,那麼必須得帶引號 例如: grep . -rn "unable to deter"

同「find」理 如果是指定資料夾下,則寫完整即可,

grep /opt/tmp/ -rn "***"

如果是當前資料夾下的某個資料夾下

grep ./tmp/ -rn "***"

還有一種比較特殊情況,如果要找帶 " 等特殊字元的資料,例如我們要找 "unable to 這樣字串

則要這樣 grep /opt/tmp/ -rn "\"unable to"

MySQL 實用命令整理

修改資料庫 表型別與預設引擎 alter table database.tables engine innodb database 資料庫名 tables 資料庫裡的表名 新增自定義mysql許可權使用者 grant allprivileges on to mysqluser identified ...

android ADB 實用命令整理

1.掛載可讀 public static final string mount system ro mount o ro,remount system 複製 2.開啟飛行模式 public static final string command airplane on settings put gl...

Linux實用命令

1.掛載samba檔案系統 mount t cifs o username guest,password adobe,codepage cp936,iocharset utf8 192.168.4.20 samba mnt samba 2.cp a 遞迴拷貝目錄,保留鏈結 d 拷貝時保留鏈結 f 覆...