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

  • Guruplug server for Xmas

    Guruplug server for Xmas

  • Getting static addresses in a Linux client under NAT and VMware Fusion

    Getting static addresses in a Linux client under NAT and VMware Fusion

  • Going KVM

    Going KVM

  • Next Pullme/Pushyou
  • Previous Configuring no-ip

Tulsa Labs © 2025. All Rights Reserved.

Powered by WordPress. Theme by Alx.