Skip to content
Watkissonline Logo

WatkissOnline – Stewart's Blog

Various ramblings from an IT professional

  • Home
  • Stewart Watkiss
  • Technical Author
  • STEM Ambassador
  • Scouts
  • Posts
ComputersLinuxProgramming

Rename files in Linux using the command line

22 April 2008 Stewart

Here are some short scripts that can be used to rename files in Linux.
These are examples that can be modified as required.

Change file extensions

Rename all files in a directory that end with .php5 to end with .php

for x in *.php5; do n=${x/.php5/.php}; mv $x $n; done

Add a prefix to a filename

for x in *.jpg; do mv $x prefix_$x; done

  • Testing Ubuntu / Xubuntu 8.04 – beta release
  • Upgraded to WordPress 2.5 – Security Updates are important

You May Also Like

Kubuntu 12.04 – Getting KDE to work with ATI Mobility Radeon HD graphics card

29 April 2012 Stewart

New Tutorial on Penguin Tutor – Linux Documentation and Help Reference Guide

22 August 2006 Stewart

Website powered by WordPress – Website in a blog

6 December 2009 Stewart
  • 3D Printing
  • Arduino
  • Babies
  • Camping
  • Children
  • Computer Networking
  • Computers
  • Cooking
  • Crafts
  • cycling
  • Days Out
  • Electronics
  • First Aid
  • Health and Safety
  • Holiday
  • IT Security
  • Linux
  • micro:bit
  • Model Railways
  • Programming
  • RaspberryPi
  • Reviews
  • Scouts
  • STEM
  • Video Editing
  • Volunteer
  • Walks
  • Web Design
  • Web Site
Copyright © 2025 WatkissOnline – Stewart's Blog. All rights reserved.
Theme: ColorMag by ThemeGrill. Powered by WordPress.