root权限打开文件夹
sudo nautilus
空文件夹删除及文件删除
sudo rmdir *** / sudo rm ***
文件复制(进入文件路径打开终端)
sudo cp -r [files] [目的路径]
更新源
sudo apt-get update
sudo apt-get upgrade
修改文件夹权限
sudo chmod 777 [name]
本地上传文件服务器
sudo scp [-r] [files] hesongze@ip:[目的路径]/home/Workspace/lyk/...
服务器下载文件
sudo scp [-r] hesongze@ip:[服务器路径/home] [本地保存路径/home]
监控显卡
watch -n 1 nvidia-smi
安装Anaconda
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.1.0-Linux-x86_64.sh
bash Anaconda3-5.1.0-Linux-x86_64.sh
source ~/.bashrc
conda -V
创建环境
conda create -n [name] python=2.7 (自动安装python)
conda create -n [name] numpy matplotlib python=2.7 (提前指定安装一些包)
激活环境
source activate [name]
退出环境
source deactivate
删除环境
conda remove -n [name] --all
下载安装
conda install [numpy==1.4.2]
搜索库(上一步无法安装)
anaconda search -t conda [numpy]
anaconda show [DavidMertz/accelerate-skimag] (搜索出包的名字)
conda install --channel https://conda.anaconda.org/DavidMertz accelerate-skimage (提示安装)
换源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
vim ~/.condarc
查看所有容器
sudo docker ps -a
查看所有镜像
sudo docker images
启动容器
sudo docker start [container_ID]
sudo NV_GPU=1 nvidia-docker start [container_ID]
进入容器
sudo attach [container_ID]
删除镜像/容器
sudo docker rm [container_ID]
rmi [image_ID]
删除同镜像ID不同Tag的镜像
sudo docker rmi -f [Repository:Tag]
容器内换源
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse" > /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse" > /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" > /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse" > /etc/apt/sources.list
sudo gedit /etc/apt/sources.list
sudo apt-get update
#sudo apt-get upgrade
报错:UnicodeEncodeError: 'ascii' codec can't encode characters in position 1279-1280
检查:>>>import sys
>>>sys.stdout.encoding 显示 'ANSI_X3.4-1968'
ANSI_X3.4-1968遇到任何中文都会报错
解决方法:sudo apt-get install language-pack-zh-hans
例如jupyter找不到
find -name jupyter
可以看出jupyter notebook是安装好的 只需要将其加入环境变量即可 (bin文件存放用户二进制文件,存常用来存放命令)
sudo vim /etc/profile #打开系统文件
export PATH=$PATH:~/anaconda3/bin #文件末尾加上
source /etc/profile #关闭文件之后更新文件即可