摘自: https://blog.csdn.net/nicolas12/article/details/80890811
壓縮、解壓
tar -cvf fille.tar file(可以多個(gè)文件空格隔開)-c: 建立壓縮檔案;-v: 顯示所有過程;-f: 使用檔案名字,是必須的,是最后一個(gè)參數(shù))
tar -xvf file.tar 解包到當(dāng)前目錄
tar -xvf file.tar -C dir 把文件解壓到指定目錄中
zip 壓縮后文件名 源文件
zip -r 壓縮后目錄名 原目錄
unzip file.zip -d dir 解壓到指定目錄
gunzip file1.gz 解壓 file1.gz
gzip file1 壓縮 file1
gzip -9 file 最大程度壓縮文件
文件、目錄
rm -f file 強(qiáng)制刪除文件,不提示
rm -r dir 遞歸刪除其文件和文件夾
rm -rf dir 強(qiáng)制刪除文件夾及其內(nèi)容,不提示
mv dir/file dir 將文件或者文件夾移動(dòng)到指定目錄
mv -t dir file 將文件或者文件夾移動(dòng)到指定目錄
mkdir dir dir2 創(chuàng)建兩個(gè)文件夾
mkdir -p /tmp/dir 創(chuàng)建多級(jí)目錄
cp file file1 將文件file復(fù)制一份file1
cp -a file/dir dir 將文件或者文件夾復(fù)制到指定目錄
cd .. 返回上一級(jí)目錄
cd ../.. 返回上兩級(jí)目錄
cd / 返回根目錄
ls 列舉出當(dāng)前目錄中所有文件
ls -a 列舉出當(dāng)前目錄中所有文件,包括隱藏文件
ls -l 顯示文件的詳細(xì)信息
ls -lrt 按時(shí)時(shí)間排序顯示文件
pwd 顯示當(dāng)前路徑
網(wǎng)絡(luò)相關(guān)
ip add 顯示當(dāng)前ip地址
ifdown eth0 禁用 ‘eth0’ 網(wǎng)絡(luò)設(shè)備
ifup eth0 啟用 ‘eth0’ 網(wǎng)絡(luò)設(shè)備
系統(tǒng)相關(guān)
su 用戶名 切換用戶登錄
shutdown -h now 關(guān)機(jī)
shutdown -r now 重啟
reboot 重啟
作者:愛新覺羅1
來源:CSDN
原文:https://blog.csdn.net/nicolas12/article/details/80890811
版權(quán)聲明:本文為博主原創(chuàng)文章,轉(zhuǎn)載請(qǐng)附上博文鏈接!