linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zavandi <zavandi@gmail.com>
To: linux-admin@vger.kernel.org
Subject: Re: deleting N lines of many files
Date: Fri, 17 Dec 2004 15:07:45 +0200	[thread overview]
Message-ID: <321aa0d204121705077f40e765@mail.gmail.com> (raw)
In-Reply-To: <41C2D20A.70404@fcaglp.unlp.edu.ar>

Fabio Zyserman <zyserman@fcaglp.unlp.edu.ar> wrote:
> I have about eighty directories,
> called data-nn, where nn=00,01,02,....
> in each of these directories I have
> among others, an (ascii) data file with many thousends
> lines. This data file has the same name in all
> directories.
> 
> I would like to know if it is possible,
> via a bash script, to delete the first N
> lines in this data file in all directories.
> The modified file can overwrite the old one.

Maybe you want something along the lines of (not tested!):

for i in `seq -w 0 80`; do sed -i "1,${N}d" $i/filename; done

  reply	other threads:[~2004-12-17 13:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-17 12:33 deleting N lines of many files Fabio Zyserman
2004-12-17 13:07 ` zavandi [this message]
2004-12-17 14:01 ` Yu Chen
2004-12-17 20:01 ` Jeff Woods

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=321aa0d204121705077f40e765@mail.gmail.com \
    --to=zavandi@gmail.com \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).