美文网首页
Linux实用命令

Linux实用命令

作者: MR来了 | 来源:发表于2021-05-17 15:16 被阅读0次

目录

  • crontab
  • conda
  • pip
  • jupyter

crontab

参数说明:

  • -e : 执行文字编辑器来设定时程表,内定的文字编辑器是 VI,如果你想用别的文字编辑器,则请先设定 VISUAL 环境变数来指定使用那个文字编辑器(比如说 setenv VISUAL joe)
  • -r : 删除目前的时程表
  • -l : 列出目前的时程表
  • f1 f2 f3 f4 f5 program
    • 其中 f1 是表示分钟,f2 表示小时,f3 表示一个月份中的第几日,f4 表示月份,f5 表示一个星期中的第几天。program 表示要执行的程序
    • 当 f1 为 * 时表示每分钟都要执行 program,f2 为 * 时表示每小时都要执行程序,其馀类推
    • 当 f1 为 a-b 时表示从第 a 分钟到第 b 分钟这段时间内要执行,f2 为 a-b 时表示从第 a 到第 b 小时都要执行,其馀类推
    • 当 f1 为 */n 时表示每 n 分钟个时间间隔执行一次,f2 为 */n 表示每 n 小时个时间间隔执行一次,其馀类推
    • 当 f1 为 a, b, c,... 时表示第 a, b, c,... 分钟要执行,f2 为 a, b, c,... 时表示第 a, b, c...个小时要执行,其馀类推
# 每一分钟执行一次 /bin/ls:
* * * * * /bin/ls
# 在 12 月内, 每天的早上 6 点到 12 点,每隔 3 个小时 0 分钟执行一次 /usr/bin/backup:
0 6-12/3 * 12 * /usr/bin/backup
# 每月每天的午夜 0 点 20 分, 2 点 20 分, 4 点 20 分....执行 echo "haha":
20 0-23/2 * * * echo "haha"

conda

## 先需要进去相关到环境里面
conda install --offline -f ***.tar.bz2
## 增加频道
conda config --append channels conda-forge
## 在jupyter启动conda环境
在环境里面:
安装ipykernel:conda install ipykernel
python -m ipykernel install --user --name ItClust --display-name "Python (ItClust)"
或者需要:
https://cloud.tencent.com/developer/article/1740328
https://segmentfault.com/a/1190000023346483
### 建立环境时候指定python版本
conda create -n env_name python=3.7

pip

## 处理过时
/Library/Frameworks/Python.framework/Versions/3.7/bin/pip --default-timeout=1000 install scanpy
## 安装线下whl
pip install ***.whl
## 使用不同镜像,优先用阿里云
pip -i https://pypi.mirrors.ustc.edu.cn/simple/ install numpy
阿里云, http://mirrors.aliyun.com/pypi/simple/
中国科技大学, https://pypi.mirrors.ustc.edu.cn/simple/
清华大学, https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣,http://pypi.douban.com/simple/

jupyter

  • 配置jupyter
## 先生成配置文件
jupyter notebook --generate-config
Writing default config to: /Users/liji/.jupyter/jupyter_notebook_config.py
## 修改默认的浏览器
c.NotebookApp.browser = 'open -a /Applications/Google\ Chrome.app %s'
## 修改默认的路径
c.NotebookApp.notebook_dir = '/Users/liji/PycharmProjects/00.Singleron'

修改jupyter的图片大小

## R版本的jupyter
options(repr.plot.width=10, repr.plot.height=8)
plot(1:20)

相关文章

网友评论

      本文标题:Linux实用命令

      本文链接:https://www.haomeiwen.com/subject/jcxyjltx.html