user commands
1.alias
[ˈālēəs]:别名
alias --help
alias -p
打印已经设置的命令别名
测试别名 l
新建命令别名 a_t 并测试
删除 命令别名
unalias
unalias --help
用 unalias 删除 a_t 命令
unalias a_t
unalias -a 取消所有命令的别名
2.install
[inˈstôl] 安装
install --help
Usage: install [OPTION]... [-T] SOURCE DEST 源 目标 or: install [OPTION]... SOURCE... DIRECTORY 源 目录 or: install [OPTION]... -t DIRECTORY SOURCE... or: install [OPTION]... -d DIRECTORY... This install program copies files (often just compiled) into destination locations you choose. If you want to download and install a ready-to-use package on a GNU/Linux system, you should instead be using a package manager like yum(1) or apt-get(1).
install 程序 会copy(通常是编译)文件到你选择的目标地点。如果你想在GUN/Linux系统上下载并安装及时可用的包,
你可以使用包管理命令 : yum(1) 或者 apt-get(1) In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to the existing DIRECTORY, while setting permission modes and owner/group. In the 4th form, create all components of the given DIRECTORY(ies). 前面三种格式,是copy 源文件到目标地 或者 copy多个文件到已存在的目录,同时可以设置权限模式和所有制/组
第四种格式,会创建所有目录以及他们的上层目录(创建给定的目录结构) Mandatory arguments to long options are mandatory for short options too.
长option 必须的参数 短option也是强制需要的 (如下面的 长option --mode=MODE -m也需要参数MODE -m=MODE) --backup[=CONTROL] make a backup of each existing destination file
为每个已存在的目标文件进行备份 -b like --backup but does not accept an argument
形如 --backup 但是不接收参数 -c (ignored) -C, --compare each pair of source and destination files, and in some cases, do not modify the destination at all
逐个比较源文件和目标文件,在某些情况下根本不用修改目标文件 -d, --directory intreat all arguments as directory names; create all components of the specified directories
参数将会被视为目录的名称,而且会创建给定的目录结构 -D create all leading components of DEST except the last, then copy SOURCE to DEST
创建除最后目录的所有主目录 并将源文件copy的目标文件 -g, --group=GROUP set group ownership, instead of process' current group
设置组所有权,替换进程当前组 -m, --mode=MODE set permission mode (as in chmod), instead of rwxr-xr-x
设定权限模式 -o, --owner=OWNER set ownership (super-user only)
设置所有权(仅限于超级用户) -p, --preserve-timestamps apply access/modification times of SOURCE files to corresponding destination files
[priˈzərv]:保留。保留时间戳,保留源文件访问和修改的时间 到相应的目标文件。 -s, --strip strip symbol tables
删除符号表 --strip-program=PROGRAM program used to strip binaries
去除二进制文件的程序 -S, --suffix=SUFFIX override the usual backup suffix
重写备份文件的后缀名 -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY
copy源文件的所有参数信息到目录 -T, --no-target-directory treat DEST as a normal file
把目标当做正常文件 -v, --verbose print the name of each directory as it is created
创建目录时打印每个目录的名称 --preserve-context preserve SELinux security context
保留 SELinux 安全上下文 -Z, --context=CONTEXT set SELinux security context of files and directories
设置 SELinux 文件和目录的安全上下文 --help display this help and exit --version output version information and exit The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values: 备份后缀为'~',除非用suffix或SIMPLE_BACKUP_SUFFIX设置。
可以通过选择 --backup option 进行版本控制 或通过 VERSION_CONTROL 环境变量设置 none, off never make backups (even if --backup is given)
永远不备份 numbered, t make numbered backups
编号备份 existing, nil numbered if numbered backups exist, simple otherwise
显示 numbered 或 simple 备份 simple, never always make simple backups 永远不做简单备份 Report install bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> For complete documentation, run: info coreutils 'install invocation'
测试
file.txt 备份到 back_file
install file.txt back_file
添加 后缀名
install -S .txt file.txt back_file
file.txt 备份到已存在目录中
install file.txt dir1/back_file.txt
file.txt 备份在不存在的指定目录
install -D file.txt dir3/back_file.txt
创建目录
install -d dir4/sub_dir1
install -dv dir5/sub #创建并打印目录
3. ar
http://liaoph.com/linux-shared-libary/
http://www.cnblogs.com/yangg518/p/5842651.html
http://blog.csdn.net/xuhongning/article/details/6365200
The GNU ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).
see also nm , ranlib
archive : [ˈärˌkīv]
Gun ar 命令 用来创建、修改 或 提取库成员。库是一个单一文件,它用一个结构保存其他文件的组织集合。这样就可以检索原始的单个文件(称为库成员)。
ar --help
Usage: ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file... ar -M [<mri-script] commands: d - delete file(s) from the archive
删除库中文件 m[ab] - move file(s) in the archive
在库中移动文件 p - print file(s) found in the archive
打印库中发现的的文件 q[f] - quick append file(s) to the archive
快速添加文件到库 r[ab][f][u] - replace existing or insert new file(s) into the archive
替换或插入文件到库 s - act as ranlib
作为ranlib命令(ranlib usage generate an index to speed access to archives: ranlib 用于生成索引以加快对库文件的访问) t - display contents of archive
显示库文件内容 x[o] - extract file(s) from the archive
从库文件中提取 command specific modifiers:
命令特定修饰符 [a] - put file(s) after [member-name]
把文件放在某成员的后面 [b] - put file(s) before [member-name] (same as [i])
把文件放在某成员的前面 [D] - use zero for timestamps and uids/gids
使用0 作为时间戳 和 uids/gids [U] - use actual timestamps and uids/gids (default)
使用实际的时间作为时间戳和uids/gids [N] - use instance [count] of name
[f] - truncate inserted file names
截取插入文件的名字 [P] - use full path names when matching
匹配时使用全路径名 [o] - preserve original dates
保留原始日期 [u] - only replace files that are newer than current archive contents
仅替换比当前库文件内容 更新 的文件 generic modifiers: [c] - do not warn if the library had to be created
如果要创建库,不要发出警告 [s] - create an archive index (cf. ranlib)
创建库索引 [S] - do not build a symbol table
不要创建符号表 [T] - make a thin archive
创建 thin archive [v] - be verbose
[vərˈbōs]:冗长的 [V] - display the version number
显示版本号 @<file> - read options from <file> --target=BFDNAME - specify the target object format as BFDNAME optional: --plugin <p> - load the specified plugin emulation options: No emulation specific options ar: supported targets: elf64-x86- elf32-i386 elf32-x86- a. elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86- pe-i386 plugin srec symbolsrec verilog tekhex binary ihex Report bugs to <http://www.sourceware.org/bugzilla/>
测试
查看 服务器中有哪些 静态库文件
find / -name '*.a' | xargs du -k
找两个比较小的文件,查看其内容
ar -t /usr/lib/x86_64-linux-gnu/libdl.a
ar -t /usr/lib/x86_64-linux-gnu/libg.a
创建静态库 libtest.a 并测试
ar r libtest.a test.o #添加 ar -t libtest.a #查看 ar q libtest.a test_2.o #追加 ar q libtest.a test_3.o #追加 ar m -a test_3.o libtest.a test.o # 移动 :test.o after test_3 ar m -b test_2.o libtest.a test_3.o #移动 :test_3.o before test_2.o ar d libtest.a test_2.o #删除
4.arch
Print machine architecture . see also uname
打印机器架构。
ar --help
arch
5.uname
Print certain system information.
打印某些信息
uname --help
Usage: uname [OPTION]... Print certain system information. With no OPTION, same as -s. 打印某些系统信息。Option 不写,同 uname -s (打印内核名称) -a, --all print all information, in the following order, 按以下顺序,打印所有信息 except omit -p and -i if unknown: 除了 -p 和 -i 之类 -s, --kernel-name print the kernel name 打印内核名称 -n, --nodename print the network node hostname 打印网络节点主机名 -r, --kernel-release print the kernel release 打印内核release 版本号 -v, --kernel-version print the kernel version 打印内核版本 -m, --machine print the machine hardware name 打印设备硬件名 -p, --processor print the processor type or "unknown" 打印处理器类型或未知 -i, --hardware-platform print the hardware platform or "unknown" 打印硬件平台或未知 -o, --operating-system print the operating system 打印操作系统 --help display this help and exit 显示此命令帮助 并退出 --version output version information and exit 输出版本信息并退出 Report uname bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> For complete documentation, run: info coreutils 'uname invocation'
测试
-----------------