标签 命令与脚本 下的文章
 2016-03-27T18:44:14.412000    |      命令与脚本    |     AilsonJack    |     暂无评论    |     4685 views
1、使用 id 命令使用 id 命令可以很轻松的通过用户名查看UID、GID,下面来讲解一下这个命令的用法。命令格式:id  [选项] ... [用户名]命令选项:-a 忽略,兼容其它版本-Z, -context 只输出当前用户的安全上下文-g, -group 只输出有效的GID-G, -groups 输出所有的GID-n, -name 对于 -ugG 输出名字而不是数值-r, -real 对于 -ugG 输出真实ID而不是有效ID-u, -user 只输出有效UID-help 输出帮助后退出-version 输出版本信息后退出使用案例:在控制台中输入命令:id root,id AilsonJack,结果如下图所示:2、查看/etc/passwd文件/etc/passwd文件格式:root:x:0:0:root:/root:/bin/bash上面是这个文件的一行实例,每个域用冒号(:)区分,从左向右分别是:root:用户名;x 密码:字符x表示密码被加密保存在/etc/shadow文件中;0 用户ID(UID):每个用户必需指定UID。UID 0是保留给root用户的,UID 1~99是保留给其它预定义用户的, UID 100~999是保留给系统用户的;0 组ID(GID):主组ID(保存在/etc/group文件中);root:用户ID信息,用户备注信息;/root 主目录:用户主目录;/bin/bash 命令解释器(shell):用户默认的命令解释器的路径。在控制台中输入命令:cat /etc/passwd | grep root
Linux命令与脚本UIDGID 阅读全文»
 2016-02-28T09:44:11.403183    |      命令与脚本    |     AilsonJack    |     暂无评论    |     1143 views
RPM(Redhat Package Manager)是用于Redhat、CentOS、Fedora等Linux 分发版(distribution)的常见的软件包管理器。因为它允许分发已编译的软件,所以用户只用一个命令就可以安装软件。rpmbuild命令被用于创建rpm的二进制软件包和源码软件包,介绍如下:#rpmbuild-bp 只作准备 (解压与打补丁)-bc 准备并编译-bi 编译并安装-bl 检验文件是否齐全-ba 编译后做成*.rpm和src.rpm-bb 编译后做成*.rpm-bs 只做成*.src.rpm-tc -ti -ta -tb -ts 的功能类似,只是所需参数由spec文件变成tar包。如:cd /usr/src/redhat/SPECSrpmbuild -bp kernel-2.6.spec更具体的用法说明:Build options with [ <specfile> | <tarball> | <source package> ]:*建立包的选项有:[从文件<specfile>建立 |从<tarball>包建立 |从<source package>包建立]1、从文件<specfile>建立-bp    build through %prep (unpack sources and apply patches) from <specfile>      *-bp 从<specfile>文件的%prep段开始建立(解开源码包并打补丁)-bc    build through %build (%prep, then compile) from <specfile>      *-bc 从<specfile>文件的%build-bi    build through %install (%prep, %build, then install) from <specfile>-bl    verify %files section from <specfile>      *检查<specfile>文件的%files段-ba    build source and binary packages from <specfile>      *建立源码和二进制包-bb    build binary package only from <specfile>      *只建立二进制包-bs    build source package only from <specfile>      *只建立源码包2、从 <tarball>包建立-tp    build through %prep (unpack sources and apply patches) from <tarball>-tc    build through %build (%prep, then compile) from <tarball>-ti    build through %install (%prep, %build, then install) from <tarball>-ta    build source and binary packages from <tarball>      *建立源码和二进制包-tb    build binary package only from <tarball>      *只建立二进制包-ts    build source package only from <tarball>      *只建立源码包3、从 <source package>包建立-rebuild     build binary package from <source package>        *建立二进制包-recompile    build through %install (%prep, %build, then install) from <source package>4、rpmbuild的其他使用项-buildroot=DIRECTORY      override build root                *确定以root目录建立包-clean             remove build tree when done                *完成打包后清除BUILD下的文件目录-nobuild            do not execute any stages of the build                *不进行BUILD的阶段-nodeps            do not verify build dependencies                *不检查建立包时的关联文件-nodirtokens          generate package header(s) compatible with (legacy) rpm packaging-rmsource            remove sources when done                *完成打包后清除sources-rmspec            remove specfile when done                *完成打包后清除specfile-short-circuit         skip straight to specified stage (only for c,i)                *跳过-target=CPU-VENDOR-OS      override target platform                *确定包的最终使用平台Common options for all rpm modes(所有rpm都可使用的选项):-D, -define='MACRO'EXPR'    define MACRO with value EXPR                *预定义-E, -eval='EXPR'        print macro expansion of EXPR                *显示大量EXPR扩展信息-macros=<FILE:…>        read <FILE:…> instead of default file(s)                *读<FILE:…>文件代替默认文件-nodigest            don’t verify package digest(s)                 *不检查包的说明信息-nosignature           don’t verify package signature(s)                *不检查包的签名信息-rcfile=<FILE:…>        read <FILE:…> instead of default file(s)                 *读<FILE:…>文件代替默认文件-r, -root=ROOT          use ROOT as top level directory (default: “/”)                *使ROOT为最高级别的路径-querytags           display known query tags                *显示已知的有疑问的地方-showrc             display final rpmrc and macro configuration                 *显示最终的配置信息-quiet             provide less detailed output                 *提供少量的信息-v, -verbose          provide more detailed output                 *提供大量的详细的信息-version            print the version of rpm being used                *显示rpm包的版本
Linux命令与脚本 阅读全文»
  • 1

  本站信息

目前本站共被浏览 154784 次
目前本站已经运行 3306 天
目前本站共有 165 篇文章
目前本站共有 6 条评论信息
目前本站共有 104 个标签
目前本站共有 0 条留言信息
网站创建时间: 2015年03月01日
最近更新时间: 2023年11月26日
Copyright © 2015~2023  说好一起走   保留所有权利   |  百度统计  蜀ICP备15004292号