conchincradle / my-public-cs-learning

0 stars 0 forks source link

Linux #29

Open conchincradle opened 1 year ago

conchincradle commented 1 year ago

apt

如果你一直用apt装软件,用apt autoremove一般没什么问题。关键是有的软件如果不是用apt装的,apt能“看到”的dependency就不一定对了。—-所以服务器的公用的还是别用

apt update:只检查,不更新(已安装的软件包是否有可用的更新,给出汇总报告)

用法:sudo apt update

apt upgrade:更新已安装的软件包

用法:sudo apt upgrade 软件包名

conchincradle commented 1 year ago

环境变量

  1. export PATH=/usr/local/cuda-11.0/bin:$PATH
  2. export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64:$LD_LIBRARY_PATH
conchincradle commented 1 year ago

[重启或关闭 Linux 系统的 6 个终端命令](https://cloud.tencent.com/developer/article/1381198?from=15425)

[Linux入门教程(更新完毕)_C语言中文网](http://c.biancheng.net/cpp/linux/)

运行以下命令则会立即关闭 Linux 设备-h now表示立刻杀死所有进程,并关闭系统:

-h:如果不特指-halt选项,则等价于-poweroff选项

外我们可以使用带有-halt选项的shutdown命令立即关闭设备:

-H、--halt:停止设备运行

好多网站显示的错误的命令,把-h当作halt

[Ubuntu Manpage: shutdown - Halt, power-off or reboot the machine](https://manpages.ubuntu.com/manpages/bionic/man8/shutdown.8.html?_ga=2.14501751.172858684.1646219013-338744557.1646219013)

[看完这篇Linux基本的操作就会了](https://zhuanlan.zhihu.com/p/36801617)

conchincradle commented 1 year ago

虚拟环境

查看cuda和cudnn版本:

cat /usr/local/cuda/version.txt

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

查看当前已有环境:

conda env list

conda create -n tensorflow1.14 python=3.6

source activate tensorflow1.9

conda install tensorflow-gpu==1.9

安装其他需要的包(如scipy,h5py):

conda install scipy

conda install h5py

退出该环境:

source deactivate

不喜欢该环境了,把它删掉:

conda remove -n tensorflow1.9 --all

复制环境:

conda create --name new_env_name --clone tensorflow1.9

conchincradle commented 1 year ago

conda

首先根据这个网址找到最新的版本-然后下载这个最新的版本文件

wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh

bash Anaconda3-2021.11-Linux-x86_64.sh

source ~/.bashrc 必须更新一下环境变量,基本上出现(base) zhu@s3_nishida:~$

左边有括号就是成功了;

conda update conda

conda update anaconda 然后conda里面虚拟环境安装自己的tookit就行了,不同于nvidia的toolkit

conchincradle commented 1 year ago

Ubuntu命令查看信息

[ubuntu查看系统信息命令-白红宇的个人博客](https://blog.css8.cn/post/19564132.html)

[科普帖:深度学习中GPU和显存分析](https://zhuanlan.zhihu.com/p/31558973)

直接用pip3 安装

sudo apt install python3-pip

conchincradle commented 1 year ago

Learning The Bash Shell读书笔记

conchincradle commented 1 year ago

SSH

https://wangdoc.com/ssh/basic.html

Gtxiaosu commented 1 year ago

哪个大神求助一下Linux的grep详细版