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...

  • Eisler is blogging over at http://nfsworld.blogspot.com/

    Eisler is blogging over at http://nfsworld.blogspot.com/

  • Installing git on Solaris Express 11

    Installing git on Solaris Express 11

  • Some random links

    Some random links

  • Next Pullme/Pushyou
  • Previous Configuring no-ip

Tulsa Labs © 2026. All Rights Reserved.

Powered by WordPress. Theme by Alx.