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

  • Filesystem in Userspace

    Filesystem in Userspace

  • [Solaris 11 Express] math.h: No such file or directory

    [Solaris 11 Express] math.h: No such file or directory

  • Exercise (specifically Yoga) and Chronic Fatigue

    Exercise (specifically Yoga) and Chronic Fatigue

  • Next Pullme/Pushyou
  • Previous Configuring no-ip

Tulsa Labs © 2026. All Rights Reserved.

Powered by WordPress. Theme by Alx.