zip 压缩

1
zip -r weights.zip /home/model/weights

-r 表示递归


scp 传文件

1
scp -r /home/cuiruochen/model/weighs.zip  root@shi.kongfei.life:22:/home/root/model/weights.zip

-r 代表递归

anaconda 删除环境

1
2
3
4
5
6
7
8
# 激活环境(如果不在环境中)
conda activate myenv

# 删除环境
conda remove --name myenv --all

# 确认删除
Proceed ([y]/n)? y

nohup 后台运行程序并重定向输出

使用 nohup 指令后台运行程序并读取 nohup.out 文件

后台运行

1
nohup sh your_bash_file.sh &

读取后台运行的程序

1
tail -f nohup.out

后台运行并输出重定向

1
nohup sh your_command.sh > output 2>&1 &

hexo 博客上传

1
2
3
hexo cl
hexo g
hexo d

查看 linux 版本

1
lsb_release -a

程序运行到指定位置退出

1
2
import sys
sys.exit(0)

1
exit(0)

显示硬盘容量和已使用容量

1
2
3
4
5
6
7
8
# 查看整体硬盘容量和已使用容量
df -h

# 查看指定目录下文件夹的硬盘容量和已使用容量
df -h /home

# 查看指定文件夹的硬盘容量和已使用容量
df -sh /home/crc/model