When archiving files with the tar command today, it kept prompting “tar: Removing leading `/’ from member names”
[root@zsf tmp]# tar -cvf test.tar /tmp/*
tar: Removing leading `/’ from member names
/tmp/123.tar
/tmp/1.txt
/tmp/2.tar
/tmp/P
tar: /tmp/test.tar: file is the archive; not dumped
Found a -P option in there to solve this problem
-P, –absolute-names
don’t strip leading ‘/’s from file names
Then we decided to test it
[root@zsf tmp]# tar -cvfP test1.tar /tmp/*
test1.tar
tar: Removing leading `/’ from member names
/tmp/123.tar
/tmp/1.txt
/tmp/2.tar
tar: /tmp/P: file is the archive; not dumped
/tmp/test1.tar
/tmp/test.tar
# Found a new error reported, why? It turns out that the -f option of the tar command must be followed by a file and nothing else. Immediately swap the f and P positions
[root@zsf tmp]# tar -cvPf test1.tar /tmp/*
/tmp/123.tar
/tmp/1.txt
/tmp/2.tar
/tmp/P
/tmp/test.tar
Done!
Similar Posts:
- Oracle ORA-00936: missing expression [How to Solve]
- Execute composer and throw killed
- VIM edit prompt swap file already exists solution
- Day 1 – meet Tornado
- [Solved] Compile Error: virtual memory exhausted: Cannot allocate memory
- Problem with the SSL CA cert (path? access rights?)
- Error in compiling APR util for Linux
- unzip error “End-of-central-directory signature not found”
- [Solved] ERROR: bootstrap checks failed memory locking requested for elasticsearch process but memory is not locked
- [Solved] Python runs import CV2 error: Legal instruction (core dumped)