时常用到linux命令及其他杂七杂八命令

记录一下,部分工作中首次遇到的小问题,当时却花费了很多时间去解决的东西。

  1. linux批量关键词删除文件
find /data/work/ptop/ -name '*_201810*' |xargs rm -rf
  1. python调用cx_Oracle包时,定时器不起作用,原因:cx_Oracle需要依赖oracle的ORACLE_HOME环境。环境变量定义时,ORACLE_HOME定义在/etc/profile下,在这里修改的内容是对所有用户起作用的,但是对crontab是不起作用,解决方式:crontab中添加ORACLE_HOME路径:
0 7 * * * . /etc/profile; /usr/bin/python /data/ptop/online.py >>/data/ptop/online.log 2>&1
  1. linux后台运行python代码时,log缓存,不能立刻输出:加 “-u”即可。
nohup python -u ptop_online.py >> ptop_online.log 2>&1 &
  1. linux用户权限限制,进入root用户操作:
sudo -i
  1. 查看mysql数据库、表大小,对应修改表名及数据库名即可,也可转换单位:
select concat(round(sum(DATA_LENGTH/1024/1024),2),'M') table_space
from information_schema.tables  
where table_schema='data_summary' AND table_name='user_detail_info';
  1. windows下设置定时器:
    schtasks参数设置参考链接:参考url
//首先创建.bat文件
// schtasks命令创建定时器
schtasks /create /sc minute /mo 1 /tn "RunPerOneMinuts" /tr E:\update_file_bj.bat //创建
schtasks /delete /tn RunPerOneMinuts /f//删除
  1. win10系统 64位 查看pip支持的文件名及版本,解决.whl is not a supported wheel on this platform问题:
import pip._internal
print(pip._internal.pep425tags.get_supported())
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值