linux 命令(alias , unalias , install ,ar , arch ,uname )

Linux ARM GNU 軟件 達人科技 2017-05-29

user commands

1.alias

[ˈālēəs]:別名

alias --help
alias -p

打印已經設置的命令別名

測試別名 l

新建命令別名 a_t 並測試

linux 命令(alias , unalias , install ,ar , arch ,uname )

刪除 命令別名

unalias

unalias --help

用 unalias 刪除 a_t 命令

unalias a_t
linux 命令(alias , unalias , install ,ar , arch ,uname )

unalias -a取消所有命令的別名

2.install

[inˈstôl] 安裝

install --help
linux 命令(alias , unalias , install ,ar , arch ,uname )
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 [email protected] 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

The GNUarprogram creates, modifies, and extracts from archives. Anarchiveis a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (calledmembersof the archive).

see also nm,ranlib

archive : [ˈärˌkīv]

Gun ar 命令 用來創建、修改 或 提取庫成員。庫是一個單一文件,它用一個結構保存其他文件的組織集合。這樣就可以檢索原始的單個文件(稱為庫成員)。

ar --help
linux 命令(alias , unalias , install ,ar , arch ,uname )
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-64 elf32-i386 elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex Report bugs to <http://www.sourceware.org/bugzilla/>

測試

查看 服務器中有哪些 靜態庫文件

find / -name '*.a' | xargs du -k
linux 命令(alias , unalias , install ,ar , arch ,uname )
 ar -t /usr/lib/x86_64-linux-gnu/libdl.a

ar -t /usr/lib/x86_64-linux-gnu/libg.a

linux 命令(alias , unalias , install ,ar , arch ,uname )
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 #刪除
linux 命令(alias , unalias , install ,ar , arch ,uname )

4.arch

Print machine architecture . see also uname

打印機器架構。

ar --help
linux 命令(alias , unalias , install ,ar , arch ,uname )
arch

5.uname

Print certain system information.

打印某些信息

uname --help
linux 命令(alias , unalias , install ,ar , arch ,uname )
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 [email protected]
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'

測試

linux 命令(alias , unalias , install ,ar , arch ,uname )

-----------------

相關推薦

推薦中...