[root@localhost ~]# [用户名@主机名 ~]#rm -f /tmp/开始|mkdir -p /old/data/test:wq:q!:set nucat -n 文件名echo "字符串"echo "chuan.edu.com" >> /data/chuan.txtecho "chuan.com" > /data/chuan.txtcp 原文件 目的目录cp 原文件 原文件.bakmv 原文件 目的目录cp 原文件 新文件rm 文件find 寻找目录范围 -type f -name "文件名"
find / -type f -name "chuan.txt"find /data -type f -name "*.txt"+1M表示大于1Mb,-1K表示小于1Kbfind 寻找目录范围 -type d -name "目录名"
find / -type d -name "data"find /root/ -type d -name "*.log" |xargs ls -lfind / -name "rabbitmq" -type d 2>/dev/nullseq 40 > ett.txtawk 'NR==20' test.txtawk 'NR>=20 && NR<=30' ett.txtawk 'NR<5 || NR>35' ett.txt准备数据
mkdir -p /chuan/test
cd /chuan
echo "chuan">test/del.sh
echo "chuan">test.sh
echo "chuan">t.sh
touch chuan.txt
touch alex.txt
sed 's#[a-zA-A]#SO#g' t.shsed -i.bak 's#[a-zA-A]#oldgirl#g' t.shfind /chuan/ -type f -name "*.sh" |xargs sed 's#chuan#newgirl#g'find /chuan/ -type f -name "*.sh" |xargs sed -i 's#chuan#newgirl#g'find /chuan/ -type f -name "*.sh" |xargs cattar zcf /tmp/etc.tar.gz /etc/
tar tf etc.tar.gztar xf etc.tar.gzyum install tree telnet -yrpm -qa treerpm -qa tree telnet lrzszrpm -ql 命令名rpm -ivh rpm包路径./congigure,可以在这里配置各种参数makemake installls -l /dev/cdrommount /dev/cdrom /mnt/cd /mnt/rpm -ivh /mnt/Packages/telnet-0.17-48.el6.x86_64.rpmdf -hhead /etc/passwdhead -5 /etc/passwd,前五行tail /etc/passwdtail -5 /etc/passwd,后五行安装的命令不在三大基本仓库
[root@chuan ~]# yum install sl cowsay -y
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.163.com
* updates: mirrors.nwsuaf.edu.cn
No package sl available.
No package cowsay available.
Error: Nothing to do
yum install epel-release -yyum install sl cowsay -yslcowsay "hello world"/etc/init.d/iptables stopchkconfigchkconfig |grep iptableschkconfig iptables offrunlevel/etc/inittab文件最后tail -1 /etc/inittabcat /etc/redhat-release uname -ruseradd chuanid chuanpasswd chuansu - chuanwhoamishutdown -r 10resuce installed systemll /etc/selinux/config
sed 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/configsed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/configvim /etc/selinux/configgetenforcesetenforce 0分钟 小时 日期 月份 周几 执行命令*表示每次,* * * * *表示每天每时每分执行一次*/n,表示每隔n(分钟/小时/天)执行crontab -e* * * * * echo chuck >> /tmp/chuan.txttail -f /tmp/chuan.txt/usr/sbin/ntpdate ntp1.aliyun.comdate -s "20100101"crontab -e*/3 * * * * /usr/sbin/ntpdate ntp1.aliyun.comdate,tail /var/log/cronls -l /var/log/cron(root) CMD (echo chuck >> /tmp/chuan.txt)You have mail in /var/spool/mail/root
*/3 * * * * /usr/sbin/ntpdate ntp1.aliyun.com > /dev/null 2>&1*/3 * * * * /usr/sbin/ntpdate ntp1.aliyun.com > /dev/cron.log 2>&1datedate -s "20180101"/usr/sbin/btpdate ntp1.aliyun.com