cp /etc/rc.sysinit /tmp/rc.sysinit
vim/tmp/rc.sysinit
:%s@^[[:space:]]\+@#&@g
sed "s/\(^ \)/#\1/g" /tmp/rc.sysinit > tmp
cat tmp > /tmp/rc.sysinit
cp /boot/grub/grub.conf /tmp/
vim /tmp/grub.conf
:%s@^[[:space:]]\+@@g
vim/tmp/rc.sysinit
:%s@^#[[:space:]]\+@@g
:1,3s/^/#&/
:%s@\(enabled\|gpgcheck\)=0@\1=1@g
0 */4 * * * cp -r /etc/ /tmp/backup/etc-$(date +%Y%m%d%H%M)
0 0 * * 2,4,6 cp -r /var/log/messages /backup/messages_logs/messages-$(date +%Y%m%d)
0 */2 * * * cat /proc/meminfo |grep "^S" >> /starts/menory.txt
0 9-18/2 * * 1,2,3,4,5 echo "howdy"
mkdir -p /tmp/testdir-$(date +%F)
#!/bin/bash
cd /tmp
for i in $(seq 1 100);do
touch file-$i
done
sed -n 'n;p' /etc/passwd |awk -F: '{print $1}'
#!/bin/bash
declare -i i=0;
cat /etc/passwd | while read -r line; do
if [ $[ $i%2 ] == 0 ]; then
echo $(echo $line | cut -d":" -f1);
fi
i=$i+1;
done
#!/bin/bash
for i in {10..19};do
useradd user$i && echo "创建user$i用户成功"|passwd --stdin user$1 &> /dev/null
done
#!/bin/bash
for i in {10..19};do
touch /tmp/file$i &> /dev/null
done
#!/bin/bash
for i in {10..19};do
chown user$i user$i /tmp/file$i &> /dev/null
done
原创文章,作者:Leexide,如若转载,请注明出处:http://www.178linux.com/56180