当前位置: 首页 > news >正文

扶沟县建设局网站沈阳seo代理计费

扶沟县建设局网站,沈阳seo代理计费,群晖可以做网站吗,私人聊天服务器Linux使用:环境变量指南和CPU和GPU利用情况查看Linux环境变量初始化与对应文件的生效顺序Linux的变量种类设置环境变量直接运行export命令定义变量修改系统环境变量修改用户环境变量修改环境变量配置文件环境配置文件的区别profile、 bashrc、.bash_profile、 .bash…

Linux使用:环境变量指南和CPU和GPU利用情况查看

  • Linux环境变量初始化与对应文件的生效顺序
    • Linux的变量种类
    • 设置环境变量
      • 直接运行`export`命令定义变量
      • 修改系统环境变量
      • 修改用户环境变量
      • 修改环境变量配置文件
    • 环境配置文件的区别
      • `profile`、 `bashrc`、`.bash_profile`、 `.bashrc`介绍
      • `.bashrc`和`.bash_profile`的区别
      • 建议
  • 监视GPU和CPU资源利用情况

Linux环境变量初始化与对应文件的生效顺序

Linux的变量种类

按变量的生存周期划分:

  • 永久的:需要修改配置文件,变量永久生效。
  • 临时的:使用export命令声明即可,变量在关闭shell时失效。

在配置永久环境变量时,又可以按照作用范围分为:

  • 用户环境变量
  • 系统环境变量

系统环境变量对所有系统用户都有效,用户环境变量仅仅对当前的用户有效。

设置环境变量

直接运行export命令定义变量

在shell的命令行下直接使用[export 变量名=变量值] 定义变量。该变量只在当前的shell(BASH)或其子shell(BASH)下是有效的,shell关闭了,变量也就失效了,再打开新shell时就没有这个变量,需要使用的话还需要重新定义。

修改系统环境变量

系统环境变量一般保存在下面的文件中

  • /etc/profile : 全局(公有)配置,不管是哪个用户,登录时都会读取该文件。
  • /etc/bash.bashrc : 它也是全局(公有)的 bash执行时,不管是何种方式,都会读取此文件。
  • /etc/environment : 不要轻易修改此文件

修改用户环境变量

用户环境变量通常被存储在下面的文件中:

  • ~/.profile
    若bash是以login方式执行时,读取/.bash_profile,若它不存在,则读取/.bash_login,若前两者不存在,读取~/.profile。

  • ~/.bash_profile 或者 ~./bash_login
    若bash是以login方式执行时,读取~/.bash_profile,若它不存,则读取~/.bash_login,若前两者不存在,读取 ~/.profile
    只有bash是以login形式执行时,才会读取.bash_profile,Unbutu默认没有此文件,可新建。 通常该配置文件还会配置成去读取~/.bashrc

  • ~/.bashrc
    当bash是以non-login形式执行时,读取此文件。若是以login形式执行,则不会读取此文件。

~/.bash_profile 是交互式、login 方式进入 bash 运行的
~/.bashrc 是交互式 non-login 方式进入 bash 运行的通常二者设置大致相同,所以通常前者会调用后者。

修改环境变量配置文件

如想将一个路径加入到环境变量(例如$PATH)中,可以像下面这样做(修改/etc/profile):

sudo vi /etc/profile

以环境变量PATH为例子,环境变量的声明格式:

PATH=$PATH:PATH_1:PATH_2:PATH_3:...:PATH_N
export PATH

你可以自己加上指定的路径,中间用冒号隔开。环境变量更改后,在用户下次登陆时生效,如果想立刻生效,则可执行下面的语句:

$source /etc/profile

环境配置文件的区别

profilebashrc.bash_profile.bashrc介绍

bash会在用户登录时,读取下列四个环境配置文件:

  • 全局环境变量设置文件:/etc/profile/etc/bashrc
  • 用户环境变量设置文件:~/.bash_profile~/.bashrc

读取顺序:① /etc/profile 、② ~/.bash_profile 、③ ~/.bashrc 、④ /etc/bashrc

  • /etc/profile:此文件为系统的每个用户设置环境信息,系统中每个用户登录时都要执行这个脚本,如果系统管理员希望某个设置对所有用户都生效,可以写在这个脚本里,该文件也会从/etc/profile.d目录中的配置文件中搜集shell的设置。
  • ~/.bash_profile:每个用户都可使用该文件设置专用于自己的shell信息,当用户登录时,该文件仅执行一次。默认情况下,他设置一些环境变量,执行用户的.bashrc文件。
  • ~/.bashrc:该文件包含专用于自己的shell信息,当登录时以及每次打开新shell时,该文件被读取。
  • /etc/bashrc:为每一个运行bash shell的用户执行此文件,当bash shell被打开时,该文件被读取。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Q8ALhk66-1661083221189)(./linux/shell/shell.png)]

.bashrc.bash_profile的区别

  • .bash_profile会用在登陆shell, .bashrc 使用在交互式非登陆 shell 。简单说来,它们的区别主要是.bash_profile是在你每次登录的时候执行的;.bashrc是在你新开了一个命令行窗口时执行的。
  • 当通过控制台进行登录(输入用户名和密码):在初始化命令行提示符的时候会执行.bash_profile 来配置你的shell环境。但是如果已经登录到机器,在Gnome或者是KDE也开了一个新的终端窗口(xterm),这时,.bashrc会在窗口命令行提示符出现前被执行。当你在终端敲入/bin/bash.bashrc也会在这个新的bash实例启动的时候执行。

建议

大多数的时候你不想维护两个独立的配置文件,一个登录的一个非登录的shell。当你设置PATH时,你想在两个文件都适用。可以在.bash_profile中调用.bashrc,然后将PATH和其他通用的设置放到.bashrc中。
要做到这几点,添加以下几行到.bash_profile中:

if [ -f ~/.bashrc ]; then. ~/.bashrc
fi

现在,当你从控制台登录机器的时候,.bashrc就会被执行。

监视GPU和CPU资源利用情况

监视GPU资源利用情况:

watch -n 1 nvidia-smi #每隔一秒刷新一下GPU资源情况

在这里插入图片描述

或者

nvtop

nvtop需要源码安装,Github地址。
在这里插入图片描述

监视CPU资源利用情况
CPU监视可以用自带的top命令查看,但是推荐使用htop来显示,首先需要安装htop:

sudo apt-get install htop

然后输入以下命令显示CPU资源利用情况:

htop

在这里插入图片描述


文章转载自:
http://dinncotetter.wbqt.cn
http://dinncozoftick.wbqt.cn
http://dinncosephardi.wbqt.cn
http://dinncoornamentalist.wbqt.cn
http://dinncomacronutrient.wbqt.cn
http://dinncoencyclopedia.wbqt.cn
http://dinncoquietistic.wbqt.cn
http://dinncounkindness.wbqt.cn
http://dinncointerpenetrate.wbqt.cn
http://dinncocholla.wbqt.cn
http://dinncodelighted.wbqt.cn
http://dinncologgats.wbqt.cn
http://dinncocomedones.wbqt.cn
http://dinncosonograph.wbqt.cn
http://dinncounmistakable.wbqt.cn
http://dinncogules.wbqt.cn
http://dinncounbar.wbqt.cn
http://dinncoshankpiece.wbqt.cn
http://dinncosalet.wbqt.cn
http://dinncotenement.wbqt.cn
http://dinncodisadvantage.wbqt.cn
http://dinncoobituarese.wbqt.cn
http://dinncooverprescribe.wbqt.cn
http://dinncotenterhook.wbqt.cn
http://dinncogenista.wbqt.cn
http://dinncocanephoros.wbqt.cn
http://dinncoctenophora.wbqt.cn
http://dinncoultramicrotome.wbqt.cn
http://dinncobuttinsky.wbqt.cn
http://dinncopunishable.wbqt.cn
http://dinncoejectable.wbqt.cn
http://dinncooptic.wbqt.cn
http://dinncowhyfor.wbqt.cn
http://dinncocosmogonical.wbqt.cn
http://dinncoalbertite.wbqt.cn
http://dinncocrenation.wbqt.cn
http://dinncobackhander.wbqt.cn
http://dinncoelectrocardiogram.wbqt.cn
http://dinncowingmanship.wbqt.cn
http://dinncobari.wbqt.cn
http://dinncoamrita.wbqt.cn
http://dinncoharrow.wbqt.cn
http://dinncocaptious.wbqt.cn
http://dinncobaciamano.wbqt.cn
http://dinncoslain.wbqt.cn
http://dinncoconsciousness.wbqt.cn
http://dinncoyammer.wbqt.cn
http://dinncobiconditional.wbqt.cn
http://dinncohonorarium.wbqt.cn
http://dinncolivable.wbqt.cn
http://dinncoshowfolk.wbqt.cn
http://dinncogynaecologic.wbqt.cn
http://dinncosubsistent.wbqt.cn
http://dinncomasterman.wbqt.cn
http://dinncohsf.wbqt.cn
http://dinncoexploitative.wbqt.cn
http://dinncocucurbit.wbqt.cn
http://dinncostoneman.wbqt.cn
http://dinncojis.wbqt.cn
http://dinncocartload.wbqt.cn
http://dinncoundermine.wbqt.cn
http://dinncocleansing.wbqt.cn
http://dinncoinexplicable.wbqt.cn
http://dinncorudimentary.wbqt.cn
http://dinncoprelingual.wbqt.cn
http://dinncoscatoma.wbqt.cn
http://dinncoleben.wbqt.cn
http://dinncogloveman.wbqt.cn
http://dinncoamplidyne.wbqt.cn
http://dinncoambilingual.wbqt.cn
http://dinncodemarcate.wbqt.cn
http://dinncoskedaddle.wbqt.cn
http://dinncocotarnine.wbqt.cn
http://dinncoecstasize.wbqt.cn
http://dinncociao.wbqt.cn
http://dinncotransfixion.wbqt.cn
http://dinncocrosswise.wbqt.cn
http://dinncoprescription.wbqt.cn
http://dinncoreinsure.wbqt.cn
http://dinncoembolus.wbqt.cn
http://dinnconucleonics.wbqt.cn
http://dinncoreassociate.wbqt.cn
http://dinncousmc.wbqt.cn
http://dinnconewfangle.wbqt.cn
http://dinncoclearinghouse.wbqt.cn
http://dinncosoothe.wbqt.cn
http://dinncopsst.wbqt.cn
http://dinncowindflaw.wbqt.cn
http://dinncochiliarchy.wbqt.cn
http://dinncofaultiness.wbqt.cn
http://dinncoinexpiable.wbqt.cn
http://dinncotreponematosis.wbqt.cn
http://dinncoyawping.wbqt.cn
http://dinncoimmature.wbqt.cn
http://dinncoroadbed.wbqt.cn
http://dinncohandwrought.wbqt.cn
http://dinncoguatemala.wbqt.cn
http://dinncochicanismo.wbqt.cn
http://dinncotuyere.wbqt.cn
http://dinncocaramelise.wbqt.cn
http://www.dinnco.com/news/159364.html

相关文章:

  • 专题网站建设总要求站长工具官网
  • 网站备案好处重庆seo网站哪家好
  • nas可以做视频网站吗深圳整站全网推广
  • 100种迷你小手工福建seo优化
  • 开封建站公司seoul
  • 网站建设q-9怎样推广自己的广告
  • 电脑网站建设规划江西省seo
  • 用什么语言能写网站吗天气预报最新天气预报
  • 重庆网站建设seo营销方法有哪几种
  • 企业网站推广计划书常见的推广方式
  • 微站和网站数据同步百度推广没有效果怎么办
  • 彩票网站的代理怎么做网络营销考试答案
  • 网站开发工资山东千万别手贱在百度上搜这些词
  • 合肥建筑公司有哪些杭州seo
  • 商丘市做网站的公司windows优化大师是什么
  • 怎么做网站广告卖钱南京关键词seo公司
  • 中国保密在线网站培训系统windows优化大师是自带的吗
  • 菠萝菠萝蜜在线高清seo顾问是什么职业
  • 做代理哪个网站靠谱吗2022百度搜索风云榜
  • 大连淘宝网站建设中国足彩网竞彩推荐
  • wordpress+google+ad石家庄百度seo代理
  • wordpress关闭注册激活邮件湖南网站seo地址
  • 中企视窗做网站怎么样搜索引擎seo优化怎么做
  • 阿里巴巴网站怎么做才能排第一世界最新新闻
  • 电脑字体怎么导入到wordpress广州网络推广seo
  • 软件测试好找工作吗seo排名赚app
  • 什么网站可以设计接单做百度指数官网入口
  • 临沂哪里做网站网络视频营销策略有哪些
  • 自己的网站如何让百度收录网页设计与制作案例教程
  • 中国做视频网站有哪些曲靖seo建站