Shell Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Shell Scripts
List All
Rename File
Rename Multiple Files
Remove Files From Folder
Fun Dancing Script
Dancing Move
FTP Login Report
Netstats

 





outsourced web hosting support

File Renamer/Renaming Script - Shell Scripts


About
Simple Shell Renamer script that can rename files in the current directory. Execute the script in the command prompt to rename a file.


Features
a) Used for renaming files.
b) Fast File Renamer.
c) No need of any installations.
d) Just copy the code and execute it in your command line.

Code
#---------- Script by hscripts.com ---------------#
#---------- Copywrite of HIOXINDIA ---------------#
#---------  More scripts @www.hscripts.com -------#

#!/bin/sh

#string to be replaced in the filename - argument 1
val1=$1
#to be replaced with - argument 2
val2=$2

for filename in ./*
do

if [ ! -d "$filename" ]; then
        #sed 's/sd/tt/g' tarnn.txt > temp; mv temp tarnn.txt
        var3=`echo $filename | sed -e "s;$val1;$val2;g"`
        mv $filename $var3
fi

# echo $filename
done;
#--------- Script by hscripts.com -----------#

Release Date - 06-04-2010
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com



Usage
a) Copy the above code and save it with .sh extension
b) Execute the sh file in command line.
c) You have to pass two arguments for renaming files. $1 is an first argument. $2 is an second argument. $1 specifies old filename and $2 specifies new filename.
d) Execute the shell script as sh filename.sh.


License
- The Unix Shell Scripts and examples is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- For Detailed License information Click here
- If your requirements does not meet GPL License terms, you can purchase the script with us.
Other Links

web hosting