• user warning: Table './drupal6/captcha_sessions' is marked as crashed and last (automatic?) repair failed query: INSERT into captcha_sessions (uid, sid, ip_address, timestamp, form_id, solution, status, attempts) VALUES (0, 'pvguao3dd0jpiig839b6t3h8j3', '54.234.42.16', 1369281221, 'comment_form', '31e4a2e11a7dba2132460d42c497506f', 0, 0) in /var/www/sites/all/modules/captcha/captcha.inc on line 99.
  • user warning: Table './drupal6/captcha_sessions' is marked as crashed and last (automatic?) repair failed query: UPDATE captcha_sessions SET token='c3b337863b688d6d8b277a485aaff4a3' WHERE csid=0 in /var/www/sites/all/modules/captcha/captcha.module on line 216.
  • user warning: Table './drupal6/captcha_sessions' is marked as crashed and last (automatic?) repair failed query: UPDATE captcha_sessions SET timestamp=1369281221, solution='JQurbF' WHERE csid=0 in /var/www/sites/all/modules/captcha/captcha.inc on line 111.

Skipping the first directory in a .tar file

Submitted by Sam on 23 February, 2012 - 00:49

Lots of the compressed files I download come in the form "project-name-1.2.3.tar.gz", and contain a directory within them named in the same format, so when you untar it creates a directory like "project-name-1.2.3", with all of the project files below it. As most of the time I seem to be already working in a new directory where I want the file to untar, I don't want to have to bother about moving the contents up a level and then deleting the old directory. The tar switch --strip-components=1 addresses this problem by removing the first directory on extraction.

See man tar | grep strip-components .

0 comments

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
      _    ___                   _       _____ 
| | / _ \ _ _ _ __ | |__ | ___|
_ | | | | | | | | | | | '__| | '_ \ | |_
| |_| | | |_| | | |_| | | | | |_) | | _|
\___/ \__\_\ \__,_| |_| |_.__/ |_|
Enter the code depicted in ASCII art style.
Attribution Noncommercial Share Alike
This text, Skipping the first directory in a .tar file, by Sam Haskell is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike license.
Drupal theme by Kiwi Themes.