[root@rhel5 ~]# ps -ef | more
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 22:42 ? 00:00:00 init [5]
Scheduler is process 0; init is process 1;
[root@rhel5 ~]# ls -i anaconda-ks.cfg
370783 anaconda-ks.cfg
[root@rhel5 ~]#
To turn debug on:
set -x
To turn debug off:
set +x
#!/bin/bash
_DEBUG="on"
function DEBUG()
{
[ "$_DEBUG" == "on" ] && $@ || :
}
DEBUG echo 'Reading files'
for i in *
do
grep 'something' $i > /dev/null
[ $? -eq 0 ] && echo "Found in $i file" || :
done
DEBUG set -x
a=2
b=3
c=$(( $a + $b ))
DEBUG set +x
echo "$a + $b = $c"
[root@rhel5 ~]# cat /etc/passwd |grep "/home" |cut -d: -f1
vernon
olivia
garry
find /tmp -name workspace.* -mtime +7 -maxdepth 1 | more
find /tmp -name workspace.* -mtime +7 -maxdepth 1 -exec rm -f {} \;
zcat oui.txt | perl -ne 'if ($_ =~ m/(\w{2})-(\w{2})-(\w{2})\s+\(hex\)\s+(.*)/) { print lc($1).lc($2).".".lc($3).",$4\n"; }'
We have 8 guests and no members online