$>ls $>ls --help //查看命令幫助 $>man ls //查看命令幫助 $>clear //清屏 $>cd /home //切換目錄 $>cd . //進入當前目錄 $>cd .. //進入上級目錄 $>cd /home/admin//進入絕對路徑 $>pwd //顯式當前目錄 $> ...
$>ls
$>ls --help //查看命令幫助
$>man ls //查看命令幫助
$>clear //清屏
$>cd /home //切換目錄
$>cd . //進入當前目錄
$>cd .. //進入上級目錄
$>cd /home/admin//進入絕對路徑
$>pwd //顯式當前目錄
$>whoami //顯式當前用戶名
$>su root //切換用戶,輸入密碼,swith user
$>passwd //修改當前用戶的密碼
$>ifconfig //查看ip地址
$>ping localhost //查看網路連通情況
$>ping www.163.com //查看網路連通情況
$>su admin //切換用戶
$>cd /home/admin //到用戶目錄
$>cd ~ //回到主目錄
$>cd - //回到上次的目錄
$>ll //別名,ls -l --autocolor...
$>alias //查看所有的別名
$>ls -a -l -h //查看當前目錄-h:人性化 -l:列表 -a:顯式.開頭
$>mkdir ~/Downloads/a //創建目錄
$>touch ~/Downloads/a/1.txt //創建文件
$>echo helloworld > 1.txt //重定向輸出(覆蓋)
$>echo helloworld >> 1.txt //重定向輸出(追加模式)
$>cat 1.txt //查看文件
$>cp 1.txt 2.txt //複製文件
$>rm 1.txt //刪除文件
$>rm -rf / //強行遞歸刪除
$>mv a.txt tmp/ //強行遞歸刪除
[centos client中切換模式]
ctrl + alt + f6 //切換到文本模式
ctrl + alt //切換滑鼠
ctrl + alt + f1 //切換桌面模式.
ctrl + alt + f5 //切換到新的文本模式
$>more a.txt //分屏顯式
q:退出
h:幫助
$>more -5 a.txt //顯式前5行內容
$>tail a.txt //最後10行內容
$>find . | more // | 是管道符,前面的命令的輸出作為後面命令輸入。
$>find ~
$>ls -aR ~ //遞歸顯式主目錄所有的文件.(a表示包含.開頭的文件)
$>head a.txt //顯式前10行
$>head -n 10 a.txt //顯式前10行
$>head -10 a.txt //顯式前10行
$>tail a.txt
$>tail -n 20 a.txt
$>tail -20 a.txt
$>tail --lines=20 a.txt
$>wc -c -l -w a.txt //統計文本信息,
//顯式統計信息-c:位元組 -l:line -w:word
$>hostname //查看主機名稱
$>uname -a //查看系統內核
$>file xxx.xx //查看文件類型
$>gzip a.txt //原地壓縮
$>gzip -d a.txt //原地壓縮
$>gzip -dr tmp //遞歸操縱文件夾下的文件
$>gunzip a.txt.gz //等價於gzip -d a.txt
$>tar -cvf my.tar 1.txt tmp //創建歸檔文件
$>tar -vxf my.tar //解檔文件
$>find . | grep txt | cp `xargs` temp //xargs是多行變單行,使用空格替換回車換行符.
//`` : 是強制命令解析。
$>ping `cat a.txt` //命令嵌套
$>which echo //查看命令的文件路徑