ubuntu下面嘚一些常用基本命令
1)环境变量配置:
9 ~/.bashrc
or
~/.bash_profile.
sudo gedit ~/.bashrc
第一种
sudo vim ~/.bashrc
export PYTHONPATH=~/caffe/python:$PYTHONPATH
export PYTHONPATH=/home/caffe/python:$PYTHONPATH
source ~/.bashrc
第二种××××××××××××个人觉得这种方式是最好嘚
sudo gedit ~/.bashrc
export PYTHONPATH=~/caffe/python:$PYTHONPATH
source ~/.bashrc
可以用下面的命令查看 LD_LIBRAY_PATH 的设置内容:
echo $LD_LIBRARY_PATH
第三种
https://blog.csdn.net/jiachen0212/article/details/79569076
sudo gedit /etc/profile
需要修改
export PATH=/usr/local/cuda9-.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH
注意生效后前面红框里的颜色都变了...
原本嘚
export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
source /etc/profile
三者区别:
Linux下 环境变量/etc/profile、/etc/bashrc、~/.bashrc的区别
在安装nsq的时候遇到环境变量的配置问题,参考的博客中既有修改/etc/profile的,也有修改~/.bashrc的……
为了搞清楚为什么修改这个,转载了一篇总结得稍好些的博客记录。地址:http://blog.csdn.net/qiao1245/article/details/44650929
最近配置了JAVA和Scala的环境变量,发现自己对Linux下 /etc/profile、/etc/bashrc、~/.bashrc的区别不是特别清楚,特此查阅了相关资料,整理下来,供以后查阅。如有错误之处,还望各位朋友批评指正。
①/etc/profile:
该文件登录操作系统时,为每个用户设置环境信息,当用户第一次登录时,该文件被执行。也就是说这个文件对每个shell都有效,用于获取系统的环境信息。
- # /etc/profile
- # System wide environment and startup programs, for login setup
- # Functions and aliases go in /etc/bashrc
- # It's NOT a good idea to change this file unless you know what you
- # are doing. It's much better to create a custom.sh shell script in
- # /etc/profile.d/ to make custom changes to your environment, as this
- # will prevent the need for merging in future updates.
②/etc/bashrc:
为每一个运行bash shell的用户执行此文件,当bash shell被打开时,该文件被读取。也就是说,当用户shell执行了bash时,运行这个文件。
- # /etc/bashrc
- # System wide functions and aliases
- # Environment stuff goes in /etc/profile
- # It's NOT a good idea to change this file unless you know what you
- # are doing. It's much better to create a custom.sh shell script in
- # /etc/profile.d/ to make custom changes to your environment, as this
- # will prevent the need for merging in future updates.
③~/.bashrc
该文件存储的是专属于个人bash shell的信息,当登录时以及每次打开一个新的shell时,执行这个文件。在这个文件里可以自定义用户专属的个人信息。
那么在用户登录系统时候,相关的文件执行顺序是什么呢。
在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile、
~/.bash_login或 ~/.profile文件中的其中一个,执行的顺序为:~/.bash_profile、 ~/.bash_login、
~/.profile。如果 ~/.bash_profile文件存在的话,一般还会执行 ~/.bashrc文件
2)python不同版本切换命令:
vim --version 查看是否支持 python
sudo update-alternatives --config vim 可以让你在 python 和 python3 之间切换
3)使用anaconda 安装caffe
conda install -c anaconda3/ caffe
4)安装和卸载程序:
1、在终端里 apt-get安装的软件:
安装软件sudo apt-get install softname1 softname2softname3……
卸载软件 sudo apt-get remove softname1 softname2 softname3……
卸载并清除配置sudo apt-get remove --purgesoftname1
更新软件信息数据库 sudo apt-get update
进行系统升级sudo apt-get upgrade, sudo apt-get distupgrade
搜索软件包 sudo apt-cache search softname1 softname2 softname3……
2、安装的deb包要用此方法:
安装deb软件包 dpkg -i xxx.deb
删除软件包 dpkg -r xxx.deb
连同配置文件一起删除 dpkg -r --purge xxx.deb
查看软件包信息 dpkg -info xxx.deb
查看文件拷贝详情 dpkg -L xxx.deb
查看系统中已安装软件包信息 dpkg -l
重新配置软件包 dpkg-reconfigure xxx
4、在“synaptic pakagemanager”里:
点搜索,输入软件名
在需要安装或卸载的软件上右击-点标记-最后点应用
5、现在还可以在 software center里面,直接卸载。
6、卸载源代码编译的的软件:
cd 源代码目录
make clean
./configure
(make)
make uninstall
rm -rf 目录
清理系统:
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
(或使用ubuntu-tweak清理)
最新文章
- prism4 StockTrader RI 项目分析一些体会2
- 9月6日表格标签(table、行、列、表头)(补)
- windows批处理中的%0 %1 %2 %3
- fiddler使用之坑
- Recall(召回率);Precision(准确率);F1-Meature(综合评价指标);true positives;false positives;false negatives.
- html中的table在android端显示
- jquery ready方法实现原理 内部原理
- Swift 响应式编程 浅析
- Mac OS 安装 Git 环境
- button点击切换,获取按钮ID
- 用shell处理以下内容 1、按单词出现频率降序排序! 2、按字母出现频率降序排序! the squid project provides a number of resources toassist users design,implement and support squid installations. Please browsethe documentation and support
- 64位进程调用32位dll的解决方法 / 程序64位化带来的问题和思考
- ubuntu14安装node0.12.7
- oracle 自动备份
- memory prefix out omni,over,out,od,octa ~O
- 32位linux(ubuntu) exec: arm-none-linux-gnueabi-g++未找到;The tslib functionality test failed!
- 如何从Windows中删除Node.js
- 个人网站搭建时linux中的相关配置记录(mysql,jdk,nginx,redis)
- java接口应用—策略设计模式
- smarty课程---smarty3的安装和使用