linux命令注意点(二)
1.删除命令 rm -rf 路径名
1、r意思是删除目录,f意思是force的缩写,强制删除,不提示。
2、如果目录为空,可以用 “rmdir 目录名”删除。
3、如果目录不为空,可以用“rm -r 目录名”删除。
2 .~与/ 的区别
~代表当前用户的目录,/代表linux文件系统的根目录
- root用户
- /代表根目录,(对于一些命令如source /etc/profile回报 -bash root commend not counld)
- ~ 代表 /root/
- 其他用户oracle
- ~代表/home/oracle
3、修改系统时间
date 查看系统时间
date -s "日期 时间" 修改sit时间
hwclock -w 软件时间写入硬件时间
[root@host02 bin]# date Wed Sep 22 10:26:47 CST 2021 [root@host02 bin]# date -s "20211009 10:06" Sat Oct 9 10:06:00 CST 2021 [root@host02 bin]# hwclock -w [root@host02 bin]# date Sat Oct 9 10:06:36 CST 2021 [root@host02 bin]#
4、修改系统时间

两种方式:
crontab [-u username] -e /-r/-l :用户定义自己的定期执行任务,-u username root 给其他用户定义定期执行任务
vim /etc/crontab :root 直接定义定期执行用户。
代码举例:
# 每分钟执行一次测试脚本 * * * * * /bin/test.sh #每周日凌晨2两执行脚本 0 2 * * 0 /bin/test.sh #每月15号发工资 * * 15 * * /bin/money.sh #rudolf 每天9点打卡上班 0 9 * * * rudolf /bin/work.sh
浙公网安备 33010602011771号