Sponsored Content
Full Discussion: rename using mv ?
Top Forums UNIX for Dummies Questions & Answers rename using mv ? Post 48846 by jim mcnamara on Thursday 18th of March 2004 06:03:14 PM
Old 03-18-2004
Try:
Code:
for filename in _1234567.*
do
    newname=`echo $filename | sed '/_//'`
    mv $filename $newname
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how can I rename the following=-^

I have a file named -^, I want to look at it, rename, etc. Any help out there?? (5 Replies)
Discussion started by: nj78
5 Replies

2. Shell Programming and Scripting

rename while doing ftp

hi friends, I writing a script to psot dataset to ceratin server.....while doing ftp I have to rename the file while which is in present server like present :test server filename data.097878. ftp server: it sholu be renamed as data.097878.zip thanks, The thing is that while... (1 Reply)
Discussion started by: Nagabhushan
1 Replies

3. UNIX for Dummies Questions & Answers

rename files help

Hi, I've already search for this issue but I found different scripts for rename files, but I don't know how to customize it for my needs. Here's what I want to do: I have a lot of files inside many directories, like this: /aa/01.txt /aa/02.txt /ab/01.txt /ab/02.txt I want all those files... (2 Replies)
Discussion started by: piltrafa
2 Replies

4. Shell Programming and Scripting

rename

hi, im doin an assignment which requires you to build a shell script to do the MS DOS style equivilant (sp?) of the rename function. What i have to do is a loop which checks the following rules and output messages (same): Can't have anything after target Can't have more than one dot Can't... (1 Reply)
Discussion started by: bohoo
1 Replies

5. UNIX for Dummies Questions & Answers

need help with rename

hi guys i am writing a script to change the filename which is enterered as input to lower case letter even if one letter is upper case i have to change it to lower case i get the input and use sed comand should i use like that sed/s/a-z/A-Z/d will it be like that can u please help me (8 Replies)
Discussion started by: farhan_t49
8 Replies

6. Shell Programming and Scripting

Rename files

Hi, I am new to Unix and i have a requirement where i need to write a shell script where i have to loop through various files present in a directory and rename them based on below criteria. Files in the folder are in the following format. _YYYYMMDD.dat] SDL_V1_20100530.dat... (6 Replies)
Discussion started by: bishoo
6 Replies

7. UNIX for Dummies Questions & Answers

Rename a file

how to rename a file if I don't know file location ? Can we below command : $ find / | mv file1.txt I am not sure........can any1 help me out ? Thanks, Tushar Joshi:mad: (1 Reply)
Discussion started by: tusharjoshi
1 Replies

8. Shell Programming and Scripting

How to use function 'rename' ?

hello, all I have following files: file_1 file_2 file_3 ... file_9 Now I want to rename them as: file_001 file_002 file_003 ... file_009 how to use function 'rename' to accomplish this task? (2 Replies)
Discussion started by: littlewenwen
2 Replies

9. UNIX for Dummies Questions & Answers

Using rename

I want to rename files Files show like this 1977SSD_rsdtst.pdf 1976SDP_rstdtsr.pdf 1943FDT_rstdsrt.pdf 1996DFF_stdstrd.pdf I want to introduce _ after the year, and move the characters to the end to get 1977_rsdtst_SSD.pdf 1976_rstdtsr_SDP.pdf 1943_rstdsrt_FDT.pdf... (4 Replies)
Discussion started by: kristinu
4 Replies

10. Shell Programming and Scripting

Using rename

Renaming files using rename on the following files rename 's/.99999/.99999.sac.pzs/g' *.99999 sac_pzs_iv_esml_hhz__2013.074.10.18.23.0000_2599.365.23.59.59.99999 sac_pzs_iv_favr_hhe__2010.187.00.00.00.0000_2599.365.23.59.59.99999... (1 Reply)
Discussion started by: kristinu
1 Replies
ZIPARCHIVE(3)								 1							     ZIPARCHIVE(3)

The ZipArchive class

INTRODUCTION
A file archive, compressed with Zip. CLASS SYNOPSIS
ZipArchive ZipArchive Properties o int$status o int$statusSys o int$numFiles o string$filename o string$comment Methods o bool ZipArchive::addEmptyDir (string $dirname) o bool ZipArchive::addFile NULL (string $filename, [string $localname], [int $start], [int $length]) o bool ZipArchive::addFromString (string $localname, string $contents) o bool ZipArchive::addGlob (string $pattern, [int $flags], [array $options = array()]) o bool ZipArchive::addPattern (string $pattern, [string $path = "."], [array $options = array()]) o bool ZipArchive::close (void ) o bool ZipArchive::deleteIndex (int $index) o bool ZipArchive::deleteName (string $name) o bool ZipArchive::extractTo (string $destination, [mixed $entries]) o string ZipArchive::getArchiveComment ([int $flags]) o string ZipArchive::getCommentIndex (int $index, [int $flags]) o string ZipArchive::getCommentName (string $name, [int $flags]) o bool ZipArchive::GetExternalAttributesIndex (int $index, int &$opsys, int &$attr, [int $flags]) o bool ZipArchive::getExternalAttributesName (string $name, int &$opsys, int &$attr, [int $flags]) o string ZipArchive::getFromIndex (int $index, [int $length], [int $flags]) o string ZipArchive::getFromName (string $name, [int $length], [int $flags]) o string ZipArchive::getNameIndex (int $index, [int $flags]) o string ZipArchive::getStatusString (void ) o resource ZipArchive::getStream (string $name) o int ZipArchive::locateName (string $name, [int $flags]) o mixed ZipArchive::open (string $filename, [int $flags]) o bool ZipArchive::renameIndex (int $index, string $newname) o bool ZipArchive::renameName (string $name, string $newname) o bool ZipArchive::setArchiveComment (string $comment) o bool ZipArchive::setCommentIndex (int $index, string $comment) o bool ZipArchive::setCommentName (string $name, string $comment) o bool ZipArchive::setExternalAttributesIndex (int $index, int $opsys, int $attr, [int $flags]) o bool ZipArchive::setExternalAttributesName (string $name, int $opsys, int $attr, [int $flags]) o public bool ZipArchive::setPassword (string $password) o array ZipArchive::statIndex (int $index, [int $flags]) o array ZipArchive::statName (string $name, [int $flags]) o bool ZipArchive::unchangeAll (void ) o bool ZipArchive::unchangeArchive (void ) o bool ZipArchive::unchangeIndex (int $index) o bool ZipArchive::unchangeName (string $name) PROPERTIES
o $status -Status of the Zip Archive o $statusSys -System status of the Zip Archive o $numFiles -Number of files in archive o $filename -File name in the file system o $comment -Comment for the archive PHP Documentation Group ZIPARCHIVE(3)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy