转自:http://blog.51cto.com/mystery888/1835223
听完马哥的Linux培训关于Linux文件系统及文件类型,有一个疑惑,同样是存放第三方应用程序的安装位置,/opt跟/usr/local 有何区别,为什么存在两个相同功能的地方,让人混淆呢。带着这个问题,我寻找了资料,原来Linux的结构是这样的。
/usr/local下一般是你安装软件的目录,这个目录就相当于在windows下的programefiles这个目录
/opt这个目录是一些大型软件的安装目录,或者是一些服务程序的安装目录
/opt
Here’s where optional stuff is put. Trying out the latest Firefox beta? Install it to /opt where you can delete it without affecting other settings. Programs in here usually live inside a single folder whick contains all of their data, libraries, etc.
/opt这里主要存放那些可选的程序。你想尝试最新的firefox测试版吗?那就装到/opt目录下吧,这样,当你尝试完,想删掉firefox的时候,你就可 以直接删除它,而不影响系统其他任何设置。安装到/opt目录下的程序,它所有的数据、库文件等等都是放在同个目录下面。
举个例子:刚才装的测试版firefox,就可以装到/opt/firefox_beta目录下,/opt/firefox_beta目录下面就包含了运 行firefox所需要的所有文件、库、数据等等。要删除firefox的时候,你只需删除/opt/firefox_beta目录即可,非常简单。
/usr/local
This is where most manually installed (ie. outside of your package manager) software goes. It has the same structure as /usr. It is a good idea to leave /usr to your package manager and put any custom scripts and things into /usr/local, since nothing important normally lives in /usr/local.
/usr/local这里主要存放那些手动安装的软件,即 不是通过“新立得”或apt-get安装的软件。
它和/usr目录具有相类似的目录结构。
让软件包管理器来管理/usr目录,而把自定义的脚本(scripts)放到/usr/local目录下面,我想这应该是个不错的主意。
PS:新立得(Synaptic)是Debian和Ubuntu Linux操作系统的包管理工具apt的图形化前端。它结合了图形界面的简单操作和 apt-get 命令行工具的强大功能
什么?看完还是不够深刻?那结合Windows作对比,简单通俗点说:
Linux 的软件安装目录是也是有讲究的,理解这一点,在对系统管理是有益的
/usr
:系统级的目录,可以理解为C:/Windows/
,/usr/lib
理解为C:/Windows/System32
。/usr/local
:用户级的程序目录,可以理解为C:/Progrem Files/
。用户自己编译的软件默认会安装到这个目录下。/opt
:用户级的程序目录,可以理解为D:/Software
,opt有可选的意思,这里可以用于放置第三方大型软件(或游戏),当你不需要时,直接rm -rf
掉即可。在硬盘容量不够时,也可将/opt单独挂载到其他磁盘上使用。
源码放哪里?/usr/src
:系统级的源码目录。/usr/local/src
:用户级的源码目录。
相关推荐
Linux 的软件安装目录是也是有讲究的,正确的选择安装目录对系统管理是有益的,这里讲解一下程序安装目录/opt目录和/usr/local目录的区别。 一、opt目录 /opt目录用来安装附加软件包,是用户级的程序目录,可以理解...
runtime library [libssl.so.1.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /home/rw/anaconda3/lib 首先查看路径,可以看到返回结果中,第一个查找路径是anaconda的。 export $PATH bash: export...
-bash: /usr/local/jdk/jdk1.8.0_181/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 安装完后 java -version 查看版本出现: 原因是:没有那个文件或目录,找了很久发现需要...
第二步:初始化mysql数据库的内部信息./scripts/mysql_install_db –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data ———————————————- 二进制包是否可以成功的运行,与先前是否先解决rpm...
出现以下报错,替换/usr/local/include/openssl里面的文件之后编译成功。add_assoc_name_entry’:/data/src/php-5.6.23/ext/openssl/openssl.c:664: warning: ‘ASN1_STRING_data’ is deprecated (declared at /usr...
从Linux系统分类,到增强型ohmyzsh插件扩展, 到与shell交互的expect脚本语言 / boot 引导程序,内核等存放的目录。 bin,普通用户可以使用的命令的存放目录,->/usr/bin /sbin 超级用户可以使用的命令的存放目录,->/...
1.把该文件所在的目录放到linux动态库链接文件中: sudo gedit /etc/ld.so.conf 输入路径: include /usr/local/lib 终端: sudo ldconfig 2.如果还不行的话,反正我试了是不行,然后在文件里搜索这个文件,...
ADD jdk-8u211-linux-x64.tar.gz /usr/local/jdk ENV JAVA_HOME /usr/local/jdk/jdk1.8.0_211 ENV JRE_HOME /usr/local/jdk/jdk1.8.0_211/jre ENV PATH $JAVA_HOME/bin:$PATH ADD flink-1.14.4-bin-scala_2.12....
2.3.2 --with-float=soft --with-headers=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux/include --with-local-prefix=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux --disable-nls --...
2.3.2 --with-float=soft --with-headers=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux/include --with-local-prefix=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux --disable-nls --...
2.3.2 --with-float=soft --with-headers=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux/include --with-local-prefix=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux --disable-nls --...
rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ tar zxvf lichee_parrotv1.1_20161202.tar.gz ... 系统当前共安装有 213805 个文件和目录。) Preparing to unpack .../libencode-locale-perl_...
linux下安装JDK步骤,非常详细,欢迎下载
系统当前共安装有 213805 个文件和目录。) Preparing to unpack .../libencode-locale-perl_1.03-1_all.deb ... Unpacking libencode-locale-perl (1.03-1) ... Selecting previously unselected package libhttp-...
内容/bin 为得到的系统操作性所需要的那些命令/boot 内核和加载内核所需的文件/dev 终端、磁盘等设备项/etc 关键的启动文件和配置文件/lib c编译器的库和部分c编译器/opt 可选,附加的应用软件包/proc 所有正在运行...
/bin 常用的二进制目录。比如:ls cp mkdir等,和/usr/bin类似 /sbin 大多涉及系统管理的命令存放,是超级权限用户root可执行.../opt 一些安装包会安装在这下面,/usr/local /proc 操作系统运行时,进程信息及内核信息
mv 11.txt /usr/ 移动 rm -rf tt.txt 删除不提示 rm tt.txt删除带提示 ifconfig 查看IP信息 export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt /bin:/usr/i686-pc-linux-gnu/...
到此这篇关于Linux bash:./xxx:无法执行二进制文件报错的文章就介绍到这了,更多相关Linux 无法执行二进制文件 内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!...
luarocks --lua-dir=/usr/local/opt/lua@5.1 path --bin) luarocks --lua-dir=/usr/local/opt/lua@5.1 install luasocket luarocks --lua-dir=/usr/local/opt/lua@5.1 install luaposix brew install enet ...