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. node - DeprecationWarning: Mongoose: `findOneAndUpdate()` and `findOneAndDelete()` without the `use

           1,  原因是因为:findOneAndUpdate()内部会使用findAndModify驱动,驱动即将被废弃,所以弹出警告!附上官方解释:Mongoose v5.5.8: Depre ...

  2. python 数据处理 对csv文件进行数据处理

    数据如下图: 用python对数据进行处理: #读取csv文件内容并进行数据处理 import os import csv import datetime import re from itertoo ...

  3. mybatis-generator-plugin

    1.背景 这篇文章刚开始想着哪个分类呢?mybatis.idea或是maven呢,最后还是选择了mybatis.最初使用这个逆向工具是在eclipse上,使用的是eclispe上mbg插件执行配置ge ...

  4. python中pandas数据分析基础3(数据索引、数据分组与分组运算、数据离散化、数据合并)

    //2019.07.19/20 python中pandas数据分析基础(数据重塑与轴向转化.数据分组与分组运算.离散化处理.多数据文件合并操作) 3.1 数据重塑与轴向转换1.层次化索引使得一个轴上拥 ...

  5. 十、Vue:Vuex实现data(){}内数据多个组件间共享

    一.概述 官方文档:https://vuex.vuejs.org/zh/installation.html 1.1vuex有什么用 Vuex:实现data(){}内数据多个组件间共享一种解决方案(类似 ...

  6. 初玩PLSQL连接 Oracle

    1. 官网下载合适的[Instant Client] https://www.oracle.com/database/technologies/instant-client/winx64-64-dow ...

  7. DStream-04 Window函数的原理和源码

    DStream 中 window 函数有两种,一种是普通 WindowedDStream,另外一种是针对 window聚合 优化的 ReducedWindowedDStream. Demo objec ...

  8. mybatis插入数据后将其ID返回

    背景 mybatis没有关联保存的功能,所以主从表需要分开保存,这就涉及到主表保存后要再次获取主表ID的环节,以下介绍mybatis插入数据后返回其自增ID的两种方式 方案 1.sql获取 <i ...

  9. POJ 1852:Ants

    Ants Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 11754   Accepted: 5167 Description ...

  10. R apply()函数

    创建一个列表变量,它的第一个元素包含所有从0到9的平方数,第二个元素为10到19之内的所有平方数,依此类推,最后一个元素为90到99之内的平方数.没有平方数的元素也应该被包含在内! 学习网友的解题思路 ...