Muffinresearch Labs by Stuart Colville

Extracting a single file from a tar backup | Comments (1)

Posted in Code, Linux/Unix on 12th November 2007, 12:49 am by Stuart

Like an idiot I accidentally overwrote a file for this blog when uploading some other stuff; accidents happen. Anyway, I have backups (you do have backups right?) and I needed to grab a single file out of the latest tar. Fortunately this is really straight forward and rather than unpacking the entire backup of all sites + dbs just to get one file you can use something like this:

tar -xf backup.1194753607.tar --wildcards *blah/index.php

As the manual states the wildcards flag enables globbing. Here’s a quick hack to flatten the output. Instead of creating the directory structure the -O flag is used to send the output to stdout and then redirect that output into the file index.php.

tar -xf backup.1194753607.tar -O --wildcards *blah/index.php > index.php

Post Tools

Comments: Add yours

1. On November 13th, 2007 at 1:29 am Nothing To Say » Blog Archive » links for 2007-11-13 said:

[...] Extracting a single file from a tar backup (tags: linux, tar, backup) [...]







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Ubuntu: Turn off changing workspace with mouse wheel|(0)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Ubuntu: Mounting a TrueCrypt volume at startup or from the CLI|(0)

All you need is a mount point e.g: mkdir /media/ and then use the following: truecrypt /path/to/truecrypt/diskimage /media/. This is handy when you want to mount a truecrypt image at start-up or just do it quickly from a shell. It’s far more direct than using the GUI.

Photos on Flickr

© Copyright 2004-09 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.840s.