6
28
2014
8

安装fio之---关于PATH变量

1.PATH环境变量作用

PATH环境变量是一组字符串。改组字符串的功能是找到linux中指令的位置,执行对应位置的指令功能。

具体说,你在任何当前目录下输入ls,都能显示当前目录下的内容,例如在/home和/usr下输入linux指令ls都能显示该目录下的内容,为什么无论在哪个目录底下输入ls指令,linux都能知道该指令是显示当前目录下的内容的呢。原因就是PATH环境变量。当你输入一个指令时,其实系统会在PATH路径下找该指令。

如果你新安装的一个软件不再现有的path的路径下,那么执行时就找不到路径,不能运行。这时需要向PATH变量添加路径

 

2.如何向PATH添加路径 

export PATH=$PATH:/usr/local/bin/fio

冒号:是PATH中不同路径的分隔符,上述指令将/usr/local/bin/fio添加到已有PATH路径中

查看当前PATH中有哪些内容:echo PATH 

运行截图如下:

由上面截图看到,路径成功添加。在添加路径之前,我们运行fio需要指令fio的位置。但添加之后可以直接使用fio ..

 

3.如何知道向PATH中添加那个目录呢

以上我是如何找到我安装的fio的路径在/usr/local/bin/fio路径下呢。这儿需要使用到which和whereis指令,系统会帮你找到你安装的fio的位置

which fio

whereis fio

which指令原理,在PATH变量中,搜索某个系统命令的位置,利用该指令可以判断系统命令是否存在以及执行的到底是哪个位置的命令

whereis命令原理:得到很多结果,该命令会把包含fio的地点都罗列出来。

 

综合来说,你可以通过whereis看到你安装同一个指令的不同版本,通过which指令来判断你当前执行的是哪个版本

which,where指令执行如下图:

4.如果某个指令安装了多个版本,如何改变系统默认指令的版本

如你的系统中安装了多个版本的gcc指令,如何切换gcc版本。如下例子说明如何从x版本切换到2.95版本。key 更改软连接

sudo ln -fs /usr/bin/gcc-2.95 /usr/bin/gcc

Category: fio | Tags: | Read Count: 2127
Avatar_small
bruin bellevue 说:
2022年8月20日 03:50

Secondary Education Core | Bellevue University 2021. Bellevue teachers vote to pause expansion of in-person learning 2021. bruin bellevue Parents grow frustrated with Bellevue teachers meeting over. Parents grow frustrated with Bellevue teachers meeting over 2021. Secondary Education Core | Bellevue University 2021. Bellevue teachers vote to pause expansion of in-person learning 2021.

Avatar_small
PUC Blueprint 2023 说:
2022年8月20日 18:57

The first and second PUC annual examinations will be conducted by the Karnataka State Government Education Department of Pre University in the months of March and April 2023. Karnataka 2nd PUC Model Question Papers 2023, PUC Blueprint 2023 Will Download PUC Blueprint 2023, Kar 12th Important Model Questions Paper 2023 Blue Print II PUC Syllabus 2023, II PUC Syllabus for Karnataka, Name of the business Languages, Commerce, and Science will be the subjects of the I and II PUC Examinations in 2023

Avatar_small
Sbi Cc Login 说:
2023年1月26日 22:42

SBI is one of the largest financial banks in India and it provides credit cards to a lot of users so they eventually understood that users. Owning a credit card is not a minute thing and it becomes a hassle if you are not able to address the payment dues which you can only know. Sbi Cc Login When you can access your online portal for the credit card through which you know about SBI credit card payment due and when so as to someone can arrange the money required and ensure the proper flow of their finances as well.

Avatar_small
Website 说:
2023年9月03日 15:35

Buy bulk Instagram accounts
Thanks for sharing the info. Keep up the good work going. I really enjoyed exploring your site. Good resource.

Avatar_small
Website 说:
2023年9月06日 01:25

Instagram pva accounts
Thanks for a wonderful share. Your article has proved the hard work and the experience you have got in this field. Brilliant. I love it reading.

Avatar_small
Gmail pva accounts 说:
2023年9月06日 03:14

I'm glad I found this website. I couldn't find any knowledge on this matter prior. Also, operate a site, and if you are ever interested in doing some visitor writing for me if possible feel free to let me know. I am always looking for people to check out my website.

Avatar_small
Website 说:
2023年10月01日 17:41

Buy gmail pva accounts in bulk
This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post!


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com