linux solaris aix上取系统前N天日期(必须安装perl)
a=`perl -le 'use POSIX;;print (strftime("%Y-%m-%d_%H-%M-%S",localtime(time()-2*86400)));'`;echo $a[@more@]
solaris 中取几天前的日期
# TZ=${TZ}+64 == 3 day ago# TZ=${TZ}+40 == 2 day ago# TZ=${TZ}+16 == 1 day agoyDATE="`TZ=${TZ}+40 date +%b %d`"echo ${yDATE}solaris 中取1,2,3天前的日期[@more@]
solaris_批量替换指定字符串_find_xargs_grep
==========================#!/bin/shapps_dir='/tmp/ddd/fj'cd ${apps_dir}/while read strs do echo ${strs} find ./ -type f | xargs perl -pi -e "s|href="${strs}|href="/|g" find ./ -type f | xargs perl -pi -e "s|href=" ${strs}|href="/|g" find ./ -type f | xargs perl -pi -e "s|src="${strs}|src="/|g" done < /tmp/ddd/string_file[@more@]==========================#!/bin/shapps_dir='/tmp/ddd/fj'cd ${apps_dir}/while
solaris 9_xargs grep递归
find ./ -type f -print | xargs file | grep text |sed -e "s/:.*//" | xargs -i grep -l '^M' {} > resultM.file while read LINE do chmod 755 $LINE dos2unix $LINE $LINE done < resultM.file==========================递归查找字符find ./sso/ -type f |grep -v 'log'|grep -v 'tar'| grep -v 'jpg'| grep -v 'JPG'|xargs grep -n 'www.sohu.com'>/tmp/www.sohu.com ===============================#!/bin/shDIR="$1"file="`echo $USER`"file_1="`basename ${DIR}`"find "
solaris 下增加新硬盘
有时候在sun服务器上插入新硬盘后,用format不能识别可执行:Solaris 8 and 以下用:# modunload -i 0 # drvconfig # devlinks # disksSolaris 9 and 以上用:#devfsadm[@more@]有时候在sun服务器上插入新硬盘后,用format不能识别可执行:Solaris 8 and 以下用:# modunload -i 0 # drvconfig # devlinks # disksSolaris 9 and 以上用:#devfsadm