Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming a bunch of files in Unix

Status
Not open for further replies.

Yusuboy

IS-IT--Management
Sep 19, 2003
6
0
0
GM
Hi guys,

I am receiving some files from a remote server and need to rename them on my Unix box before they can be processed. Any ideas on how to do this, with a script maybe?

Yus.
 
Hi

Want to rename automatically or manually ? Receiving through what protocol ? Rename what to what ? Why [tt]mv[/tt] and/or [tt]rename[/tt] is not enough ?

Feherke.
 
Hi

I want to rename the file automatically as they are being received every few mins.

Yus.
 
Hi

Maybe use [tt]cron[/tt] ? This will run each 5 minutes and change the extension of files in the given directory :
Code:
*/5 * * * * rename ".htm" ".html" /tmp/html_documents/*.htm

Feherke.
 
Feherke, which flavor of *nix has a rename command ?
 
Hi

Code:
[blue]master #[/blue] cat /etc/SuSE-release 
SuSE Linux 8.1 (i386)
VERSION = 8.1

[blue]master #[/blue] rename --version
rename from util-linux-2.11u

[blue]master #[/blue] file -b `which rename`
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped
On our old Debian was abit different [tt]rename[/tt], that one was a script.

Feherke.
 
feherke, here is the -General UNIX discussion Forum and you have to know that
Stallman said:
GNU is Not Unix
;-)
 
SCO_SV 5.0.5




______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top