![]() to ensure that find only considers files starting at the first subdirectory-level below dir/. Replace filename.xml with the name of the XML file you want to view. ![]() For example, cd /usr/local/files takes you to a directory called /usr/local/files. Note that the terminating the command-to-be-executed must really be escaped with a \, otherwise the shell will interpret it before it reaches find.Īlso, if the dir/ directory itself can contain an archive.zip that you don't want extracted, you have to add the -mindepth 1 argument after the starting point. 2 Navigate to the directory containing your XML file. It will have the same effect as saying cd 001/ unzip archive.zip cd. 581) To improve as an engineer, get better at requesting (and receiving) feedback Featured on Meta. The Overflow Blog Stress test your code as you write it (Ep. ![]() You can also specify a path to the file: tar -xvf foo.tar docs/bar.txt tar -xzvf docs/bar.txt tar -xjvf 2 docs/bar.txt. linux ubuntu tar or ask your own question. type f -name "archive.zip" -execdir unzip being the reference to the name of the found file (which find will replace with the actual filename - in this case, simply archive.zip). It is an archive file with several other files inside it, which is then compressed. Extract a file bar.txt, from an archive: tar -xvf foo.tar bar.txt tar -xzvf bar.txt tar -xjvf 2 bar.txt. Change to the directory dir, and issue the following command: find.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |