Linux Comm Ar
# Linux ar Command
[ Linux Command Manual](#)
The Linux ar command is used to create or modify archive files, or to extract files from archives.
ar allows you to gather multiple files into a single archive file. Within the archive file, all member files retain their original attributes and permissions.
### Syntax
ar
**Parameters**:
**Essential Parameters**:
* -d Delete member files from the archive.
* -m Change the order of member files within the archive.
* -p Display the contents of member files in the archive.
* -q Append files to the end of the archive.
* -r Insert files into the archive.
* -t Display the files contained in the archive.
* -x Extract member files from the archive.
**Option Parameters**:
* a Insert files after a specified member file in the archive.
* b Insert files before a specified member file in the archive.
* c Create the archive file.
* f To avoid incompatibility with other systems' ar commands due to excessively long file names, this parameter can be used to truncate the long member file names before placing them into the archive.
* i Insert files before a specified member file in the archive.
* o Preserve the dates of files in the archive.
* s If the archive contains object modules, this parameter can be used to create a symbol table for the archive.
* S Do not generate a symbol table.
* u Only insert files that are newer than the existing files in the archive.
* v Display detailed information during program execution.
* V Display version information.
### Examples
Packing files
[root@.com ~]# ls //List files in the current directory a.c b.c d.c install.log qte anaconda-ks.cfg c.c Desktop [root@.com ~]# ar rv one.bak a.c b.c //Pack a.c and b.c files ar: creating one.bak a - a.c a - b.c [root@.com ~]#
Packing multiple files
[root@.com ~]# ar rv two.bak *.c //Pack files ending with .c ar: creating two.bak a - a.c a - b.c a - c.c a - d.c [root@.com ~]#
Displaying the contents of the packed file
[root@.com ~]# ar t two.bak a.c b.c c.c d.c [root@.com ~]#
Deleting member files from the packed file
[root@.com ~]# ar d two.bak a.c b.c c.c [root@.com ~]# ar t two.bak d.c
[ Linux Command Manual](#)
AI is thinking...
[](#)(#)
(#)[](#)
[Volcengine Coding Plan supports mainstream large models like Doubao, GLM, DeepSeek, Kimi, MiniMax, etc. Officially supplied, stable and reliable. Configuration Guide Β₯9.9/month Activate Now](https://maas.xfyun.cn/modelSquare?ch=maas_lm_l2E)
### Click me to share notes
YouTip