centos7基础操作命令
1 创建周期定时任务
注意事项: 该用户是否具有执行该文件的权限是定时任务是否能够定时执行的关键
crontab -u apple -e ##添加任务,并进入编辑模式 编辑器中数据
10 * * * * bash /home/apple/checkHost.sh ## 执行时间+ 执行命令 执行时间=分钟.小时.月份。星期
crontab -u apple -l ## 显示任务详情
/sbin/service crond status ## 查看服务开启状态.当然也可以start stop restart
/sbin/sercice crond reload ## 重载
2 命令行界面不能使用tab补全
有时间我们登录进入一个账户,输入命令的时候不能使用TAB 也不能使用删除 ,光标也不能移动。使用下面命令就可以解决
python -c "import pty;pty.spawn('/bin/bash')" ## 调用 python 中的命令行
用户当前使用状态
更改后状态
cnetos7 更换源文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache ## 跟新缓存文件
解释:
/ etc/yum.repos.d/ ## 源文件存放位置
/CentOS-Base.repo ## 替换的文件
wget -O ## --output-document=file ## 将下载文件写入到
阿里源 http://mirrors.aliyun.com/repo/
编辑 /etc/yum.repos.d/ 中的相应文件,在 mirrorlist= 开头行前面加 # 注释掉;
将 baseurl= 开头行取消注释(如果被注释的话)。 对于 CentOS 7 ,请把该行内的域名(例如mirror.centos.org)替换为 mirrors.tuna.tsinghua.edu.cn。
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo
清华源 https://mirrors.tuna.tsinghua.edu.cn/help/centos/
kali 下载网址
https://www.kali.org/