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的区别

2017年10月09日 15:05:11 icodingbird 阅读数:459更多

个人分类: Linux
 

在安装nsq的时候遇到环境变量的配置问题,参考的博客中既有修改/etc/profile的,也有修改~/.bashrc的……

为了搞清楚为什么修改这个,转载了一篇总结得稍好些的博客记录。地址:http://blog.csdn.net/qiao1245/article/details/44650929

最近配置了JAVA和Scala的环境变量,发现自己对Linux下 /etc/profile、/etc/bashrc、~/.bashrc的区别不是特别清楚,特此查阅了相关资料,整理下来,供以后查阅。如有错误之处,还望各位朋友批评指正。 
①/etc/profile: 
该文件登录操作系统时,为每个用户设置环境信息,当用户第一次登录时,该文件被执行。也就是说这个文件对每个shell都有效,用于获取系统的环境信息。

  1. # /etc/profile
  2.  
  3. # System wide environment and startup programs, for login setup
  4. # Functions and aliases go in /etc/bashrc
  5.  
  6. # It's NOT a good idea to change this file unless you know what you
  7. # are doing. It's much better to create a custom.sh shell script in
  8. # /etc/profile.d/ to make custom changes to your environment, as this
  9. # will prevent the need for merging in future updates.

②/etc/bashrc: 
为每一个运行bash shell的用户执行此文件,当bash shell被打开时,该文件被读取。也就是说,当用户shell执行了bash时,运行这个文件。

  1. # /etc/bashrc
  2.  
  3. # System wide functions and aliases
  4. # Environment stuff goes in /etc/profile
  5.  
  6. # It's NOT a good idea to change this file unless you know what you
  7. # are doing. It's much better to create a custom.sh shell script in
  8. # /etc/profile.d/ to make custom changes to your environment, as this
  9. # 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清理)

ubuntu下面嘚一些常用基本命令的更多相关文章

  1. ffplay的快捷键以及选项 FFmpeg 基本用法 FFmpeg常用基本命令 ffmpeg常用转换命令,支持WAV转AMR

    ffmpeg -i 32_mkv_h264_718x480_ac3.mkv  -codec copy -bsf:v h264_mp4toannexb  -f mpegts xx.ts ./ffmpeg ...

  2. Linux(centos)的常用基本命令

    Linux的常用基本命令. 首先启动Linux.启动完毕后需要进行用户的登录,选择登陆的用户不同自然权限也不一样,其中“系统管理员”拥有最高权限. 在启动Linux后屏幕出现如下界面显示: …… Re ...

  3. ffmpeg常用基本命令(转)

    [FFmpeg]FFmpeg常用基本命令 1.分离视频音频流 ffmpeg -i input_file -vcodec copy -an output_file_video //分离视频流 ffmpe ...

  4. Linux的常用基本命令

    Linux的常用基本命令. 首先启动Linux.启动完毕后需要进行用户的登录,选择登陆的用户不同自然权限也不一样,其中“系统管理员”拥有最高权限. 在启动Linux后屏幕出现如下界面显示: …… Re ...

  5. FFmpeg常用基本命令

    FFmpeg常用基本命令 1.分离视频音频流 ffmpeg -i input_file -vcodec copy -an output_file_video //分离视频流 ffmpeg -i inp ...

  6. Linux的常用基本命令。

    Linux的常用基本命令. 首先启动Linux.启动完毕后需要进行用户的登录,选择登陆的用户不同自然权限也不一样,其中"系统管理员"拥有最高权限. 在启动Linux后屏幕出现如下界 ...

  7. 【转】ffmpeg常用基本命令

    [FFmpeg]FFmpeg常用基本命令 1.分离视频音频流 ffmpeg -i input_file -vcodec copy -an output_file_video //分离视频流 ffmpe ...

  8. Linux常用基本命令(less)

    转: Linux常用基本命令(less) LESS:跟more命令的功能类似,都是用于分页显示内容,但是他的性能比more更高,功能比more更丰富,他读取文件是按需加载 格式: less [opti ...

  9. Linux 常用基本命令及应用技巧

    需要pdf 版 联系我 我的文件中有目录一.Linux 的常用基本命令................................................................. ...

随机推荐

  1. Koa2+mongoose

    为什么选择Koa koa是Express框架同个公司的产品,是开发者在node7.0版本之后使用promise的api把express再次封装了一次,起名Koa,==Koa=Express+Promi ...

  2. 014.CI4框架CodeIgniter数据库操作之:查询数据库,并让数据以对象的方式返回查询结果

    01. 我们在CI4框架中的Model文件夹新建一个User_model.php的文件,使用的是getResultArray,表示并让数据以数组的方式返回查询结果,代码如下: <?php nam ...

  3. 使用Hibarnate: 出现 java.sql.SQLException: ORA-00911: 无效字符, 解决思路

    1. 查看到: Hibernat自动生成的sql查询语句 Hibernate: select * from ( select module0_.MODULE_ID as MODULE_ID1_1_, ...

  4. 入门QT5 D1 Widget的移动

    又重温了一遍C++之后来看QT教程了.QT之前也看过,不过都是很长时间之前了,一直也用到. 反过来再一学,这是和学新的是一样一样的. 首先创建新项目. 1.点击NEW PROJECT 2.Applit ...

  5. Web移动前端开发-——rem+less+媒体查询,rem+flexble.js+媒体查询

    实际开发搞搞起来!!!! rem适配方案 媒体查询+rem+less 基础知识铺垫 第一步,我们需要拿到设计稿,安装设计稿的要求来设置一个合适的html字体大小. 第二步,计算元素大小的取值 页面re ...

  6. Elasticsearch常用的设置

    action.destructive_requires_name: true     用于设置删除只限于特定名称指向的数据, 而不允许通过指定 _all来删除所有索引

  7. Elasticsearch全文搜索引擎-PHP使用教程。

    1.声明依赖关系:         比方说,你的项目中需要一个php版的elasticsearch框架.为了将它添加到你的项目中(下载),你所需要做的就是创建一个 composer.json 文件,其 ...

  8. 常用Java工具类

    一. org.apache.commons.io.IOUtils closeQuietly:关闭一个IO流.socket.或者selector且不抛出异常,通常放在finally块 toString: ...

  9. 153-PHP htmlentities函数

    <?php //定义一个HTML代码字符串 $str=<<<HTM <a href=#><b><i>到一个网址的链接</i>&l ...

  10. 095-PHP遍历关联数组,并修改数组元素值

    <?php $arr=array('I'=>1,'II'=>2,'III'=>3,'IV'=>4,'V'=>5); //定义一个数组 echo '修改之前数组信息: ...