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. vs2010编译C++ 运算符

    // CTest.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> #include &l ...

  2. Day6 - B - 采花 HYSBZ - 2743

    萧芸斓是Z国的公主,平时的一大爱好是采花.今天天气晴朗,阳光明媚,公主清晨便去了皇宫中新建的花园采花 .花园足够大,容纳了n朵花,花有c种颜色(用整数1-c表示),且花是排成一排的,以便于公主采花.公 ...

  3. 011.Delphi插件之QPlugins,延时加载服务

    这个DEMO是是把DLL插件的相关信息做成了一个配置文件,主程序加载这个配置文件,从而起到延时加载的作用 主程序代码如下 unit Frm_Main; interface uses Winapi.Wi ...

  4. PHP数组——定义,类型,遍历数组,数组函数

    1.定义 $attr=array();                            //标准定义方式 $attr=[1,2]; $attr[0]="hello";     ...

  5. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-ok

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...

  6. 浅析Java NIO

    浅析Java NIO 前言   在说NIO之前,先来说说IO的读写原理.我们都知道Java中的IO流可以分为网络IO流和文件IO流,前者在网络中使用,后者在操作文件时使用.但实际上两种流区别并不是太大 ...

  7. js数据类型 判断

    1. js数据类型(两种数据类型) 基本数据类型:null undefined number boolean symbol string 引用数据类型: array object null: 空对象 ...

  8. Linux每日练习-批量删除用户,非脚本运行方式 20200225

  9. 154. 寻找旋转排序数组中的最小值 II

    转跳点:--\(˙<>˙)/-- 原本打算大年三十十一起写完的,结果这篇拖到了年初一…… 这道题比刚刚那道,麻烦一点,因为有重复,所以我们需要考虑重复的情况,就是刚刚的两种情况变成了三种: ...

  10. 侯捷C++学习(二)

    #include <iostream>using namespace std;class complex{ public: complex (double r= 0, double i = ...