Sample Header Ad - 728x90

tar - file not found in tarball even though it is there

0 votes
1 answer
1108 views
What I want to do ----------------- I just want to extract a backup version of a file for analysis, /etc/net.cfg, which is in a tar. What happens when I try ----------------------- It fails, like so... # tar -tf mytar.tar | grep net.cfg /etc/net.cfg # tar -xf mytar.tar /etc/net.cfg tar: Removing leading `/' from absolute path names in the archive # tar -xf mytar.tar etc/net.cfg tar: etc/net.cfg: Not found in archive tar: Error exit delayed from previous errors Troubleshooting I've tried -------------------------- I made a separate test.tar which contains only a "test1.txt" and "test2.txt", and if I do tar xf test.tar test1.txt it correctly extracts just the 1 file I want. So extracting the single file is working in this other case. Question -------- Am I doing something wrong? **How do I extract from an *absolute path* like /etc/net.cfg out of the given tar file into the working directory?** Details ------- Operating system: QNX Shell: /bin/ksh
Asked by Aaron (187 rep)
Sep 5, 2019, 06:12 PM
Last activity: Sep 5, 2019, 06:40 PM