#list_nail_sort/list_nonail_sort: generated by "rpm -qa>list_nail_sort/list_nonail_sort" from to different linux system
#function: Get the different rpm from two file and write to file "diff"
for i in `cat list_nail_sort` ; do
((k=0))
for j in `cat list_nonail_sort` ; do
if [ $i == $j ]; then
((k=1))
break
fi
done
if [ $k -eq 0 ]; then
echo $i >> diff
fi
done
#!/bin/sh
#get the rpm name from parameter 1, paremater 1 should be a file containing rpm list, the new generated rpm name ignore rpm version
for i in `cat $1`; do
echo $i |awk -F-[0-9] '{print $1}'
done
#!/bin/sh
#Depth first Directory list
dtree() {
PWD=`pwd | sed 's/\/\$//'`
for d in $*
do
if [ $d != "*" ]
then echo "${PWD}/$d"
du -sh ${PWD}/$d
fi
[ -d "$d" -a -x "$d" ] && {
cd "$d"
((depth="$depth"-1))
if [ $depth -ge 0 ]
then dtree *
fi
cd ..
((depth="$depth"+1))
PWD=`pwd | sed 's/\/\$//'`
}
done
}
#Width first Directory list
wtree() {
PWD=`pwd | sed 's/\/\$//'`
for d in $*
do
if [ $d != "*" ]
then echo "${PWD}/$d"
du -s ${PWD}/$d
fi
done
for d in $*
do
[ -d "$d" -a -x "$d" ] && {
cd $d
((depth=$depth-1))
if [ $depth -gt 0 ]
then wtree *
fi
cd ..
((depth=$depth+1))
}
done
}
#Directory list
tree() {
PWD=`pwd | sed 's/\/\$//'`
for d in $*
do
echo ${PWD}/$d
done
}
#main
depth=3
TREE=`basename $0`
if [ "$1" ]
then DIR="$1"
else DIR="."
fi
echo $DIR
du -s $DIR
if cd $DIR
then dtree *
else echo "$0: Directory $1 read fail."
fi
#!/bin/sh
#get command information
dircount=`echo $PATH | awk -F: '{print NF}'`
((counter=1))
while [ ${counter} -le ${dircount} ]
do
curdir=`echo $echo $PATH | awk -F: '{print $'"$counter"'}'`
((counter=$counter+1))
for com in `ls $curdir`
do
fullname=`which $com`
echo $fullname
rpm -qf $fullname
result=`whatis $com|grep "nothing appropriate"`
[ -z "$result" ] && whatis $com
done
done