Skip to content

Tulsa Labs

Blog? Or a dump of things that make my life easier?

Quick hack to rename all prefixed files in a directory to a new prefix

loghyr:xxx thomas$ ls -1 pnfswars* | sed ‘s/\(pnfswars\)\(.*\)/mv \1\2 lnfsreg\2/’ | sh

And to do this as a script:

loghyr:xxx thomas$ more reprefix.sh
#! /bin/sh
ls -1 ${1}* | sed ‘s/\(‘${1}’\)\(.*\)/mv \1\2 ‘${2}’\2/’ | sh

Share
April 13, 2014 by tdh tricks

You may also like...

  • Pinefs

    Pinefs

  • Archived off the NAS Conference presentations

    Archived off the NAS Conference presentations

  • Creating a small zpool for testing

    Creating a small zpool for testing

  • Next Pullme/Pushyou
  • Previous Configuring no-ip

Tulsa Labs © 2026. All Rights Reserved.

Powered by WordPress. Theme by Alx.