$ mv /home/user/oldname /home/user/newname
- 统计当前目录下文件的个数(不包括目录)
$ ls -l | grep "^-" | wc -l
- 统计当前目录下文件的个数(包括子目录)
$ ls -lR| grep "^-" | wc -l
- 查看某目录下文件夹 (目录) 的个数(包括子目录)
$ ls -lR | grep "^d" | wc -l
$ cat /etc/os-release
跑深度学习代码的时候,Ctrl + C 取消代码后显存往往还会被占用,这样别人或者自己就不能再用了,所以需要把显存都清掉
pkill -u yimian
ls -l
默认的大小是 B,长长一串,可以用 ls -lh
这样显示的单位是 MB
$ ps -p $$
时间最近的在前面
$ ls -lt
时间从前到后
$ ls -ltr
$ ls -ltr | sort -R >> trainvaltest.txt
-R
是 Random 的意思, 然后配合 Sublime Text 的 Column Select, 在 Mac 上快捷键是 Option + 左键
$ watch -n 0.1 -d nvidia-smi #每隔 0.1 秒刷新一次
如果一个文件很长, 但我只关心文件最后的内容的动态变化:
watch -n 0.1 -d "cat FCN_DENTIST_best_IoU.log | tail -n $(($LINES - 2))"
下面 3 个命令都可以, 至少在 centos 上可以
$ cat /etc/os-release
$ lsb_release -a
$ hostnamectl
$ du -h --max-depth=1
安装排错:
在 ~/.bashrc 中添加下面内容
export PATH="<path to anaconda>bin:$PATH"
把 <path to anaconda>
换成安装 conda 安装的路径, 比如 /root/miniconda3/, 然后再 source ~/.bashrc 就好了
df -hl
nohupping backgrounded jobs is typically used to avoid terminating them when logging off from a remote SSH session
$ nohup python 3.6 sdfs.py&> result.out&
$ nohup sh script.sh &
Nohup catches the HUP signals. Nohup doesn't put the job automatically in the background. We need to tell that explicitly using &
ffmpeg -i input.mkv -r 0.05 image_sequence%06d.png
-r 0.05 = 0.05 Hz = 3 images per minute. It sometimes includes a few extra frames from the start though. Without -r it saves every frame.
把 0.05 改成 1 就是 1 秒 1 个