av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

bash高級使用方法

linux的發(fā)布版本之一——Redhat/CentOS——系統(tǒng)默認(rèn)安裝的shell叫做bash,即Bourne Again Shell,它是sh(Bourne Shell)的增強(qiáng)版本。Bourn Shell 是最早行起來的一個shell,創(chuàng)始人叫Steven Bourne,為了紀(jì)念他所以叫做Bourn Shell,檢稱sh,本篇文章重點(diǎn)為大家分享一下bash高級使用方法。

創(chuàng)新互聯(lián)建站是一家專業(yè)提供湘橋企業(yè)網(wǎng)站建設(shè),專注與成都做網(wǎng)站、網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)、H5網(wǎng)站設(shè)計、小程序制作等業(yè)務(wù)。10年已為湘橋眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)的建站公司優(yōu)惠進(jìn)行中。

1. 按時間先后,列出最后的十個目錄

ls /mnt/daily/Concord/main -sort -t | awk /_[0-9]+-[0-9]/'{print $NF}' | tail -10
/mnt/daily/LotusLive目錄內(nèi)容如下:
SC10.0_Docs :dir
SC10.0_DocsProxy :dir
SC20.0_Docs :dir
SC20.0_DocsProxy :dir
SC30.0_Docs :dir
SC30.0_DocsProxy :dir
SC30.16_Docs :dir
SC30.16_Viewer :dir
tsm_backup :file

2. 遞歸刪除空目錄

# $1必須是絕對路徑
crurl=$1
func_hdir(){
echo $crurl
cd $crurl
for aitem in `ls -l | grep "^d" | awk '{print $9}'`; do
crurl=$crurl/$aitem
func_hdir $aitem
done

dirc=`ls $crurl`
if [ "$dirc" = "" ]
then
echo $crurl
rm -rf $crurl
fi
crurl=${crurl%/*}
}

func_hdir

3. sed刪除特定的行

sed -e '/^[ ]*$/d' osgi_file > target_file //刪除空行
sed -d '/concord/d' osgi_file>target_file//包涵concord的行

4. 輸出最新的N個目錄

find /mnt/daily/Concord/main -mindepth 1 -maxdepth 1 -type d -printf "%T@%Tx %p" | sort -n -r | head -N

5. 輸出最近5天創(chuàng)建的目錄

find /mnt/daily/Concord/main -mindepth1 -maxdepth 1 -type d -mtime -5
-mtime 最大數(shù)是8,超過8就是輸出全部

6. sort by 特定列

如當(dāng)前工作中的應(yīng)用,以MSG_NODE_%d排序,可用如下命令
find . -type f -name envconfs.conf | grep -v "chatroom"| grep "appnodemessagepool"| sort -t '.' -k4
find . -type f -name envconfs.conf|grep "appnodemessagepool"|sort -t '/' -k2
./com.rcloud.appnodemessagepool.MSG_NODE_3/conf/envconfs.conf
./com.rcloud.appnodemessagepool.MSG_NODE_4/conf/envconfs.conf
./com.rcloud.appnodemessagepool.MSG_NODE_5/conf/envconfs.conf

網(wǎng)頁題目:bash高級使用方法
URL鏈接:http://uogjgqi.cn/article/djgdioh.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們在微信上24小時期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流