Renaming Large Files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Renaming Large Files
# 1  
Old 08-06-2009
Renaming Large Files

When I have a file for example with the wrong name I normally use the cp {filename} {new filename} comand so I will have the original as well as the correct named file. Just for backup purposes.

Problem: I have a file that is 24gb with a case sensitive filename. The file was named with upper case but the script is looking for lower case. What is the easiest and quickiest way to rename the file. I dont want to use cp as it will take to long and space is an issue.

Will the mv command copy the contents of the file to the new name or will it just rename the file?

Thanks
# 2  
Old 08-06-2009
Hi,
mv will rename the file as long as you stay in the same directory.
Example for rename:
Code:
mv file.a file.b

Example for copy & delete:
Code:
mv file.a ..

# 3  
Old 08-06-2009
Thanks
# 4  
Old 08-06-2009
Or, if you want to keep the file with the old name too, link it:
Code:
ln -s CASE.SENSITIVE case.sensitive

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Renaming multiple files in sftp server in a get files script

Hi, In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this? I am using #!/bin/ksh For eg: sftp user@host <<EOF cd /path get *.txt rename *.txt *.txt.done ... (7 Replies)
Discussion started by: jhilmil
7 Replies

2. Shell Programming and Scripting

Splitting large file and renaming based on field

I am trying to update an older program on a small cluster. It uses individual files to send jobs to each node. However the newer database comes as one large file, containing over 10,000 records. I therefore need to split this file. It looks like this: HMMER3/b NAME 1-cysPrx_C ACC ... (2 Replies)
Discussion started by: fozrun
2 Replies

3. Shell Programming and Scripting

Moving and renaming large ammount of files

Hey, I'm kinda new to the shell scripting and I don't wanna mess things up yet :) Looking for a solution to the following: I need to move all the files like "filename.failed.dateandtime" to another directory also renaming them "filename.ready". I can't figure how to do this with multiple files... (4 Replies)
Discussion started by: sg3
4 Replies

4. UNIX for Dummies Questions & Answers

Renaming all files

Hi, Very silly question. I need to rename all my files located in one particular folder. The names are Results1.dis, Results2.dis, Results3.dis, etc. I need to change the names to Results001.dis, Results002.dis, Results003 so on and so forth. Now, Files with double digits such as Results17.dis... (3 Replies)
Discussion started by: Xterra
3 Replies

5. Shell Programming and Scripting

renaming files or adding a name in the beginning of all files in a folder

Hi All I have a folder that contains hundreds of file with a names 3.msa 4.msa 21.msa 6.msa 345.msa 456.msa 98.msa ... ... ... I need rename each of this file by adding "core_" in the begiining of each file such as core_3.msa core_4.msa core_21.msa (4 Replies)
Discussion started by: Lucky Ali
4 Replies

6. UNIX for Advanced & Expert Users

Renaming files

Hello Please can someone help. We are being sent a directiory full of images. The names of these images can vary in length and have spaces in them. example: nn 999999 nnnnn nnnn nnnn nn nnn nnn nn nnnn.pdf what we want to do is rename all the images. Take the first two fields nn 999999 and... (23 Replies)
Discussion started by: Dolph
23 Replies

7. Solaris

How to safely copy full filesystems with large files (10Gb files)

Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS. I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies

8. Shell Programming and Scripting

Divide large data files into smaller files

Hello everyone! I have 2 types of files in the following format: 1) *.fa >1234 ...some text... >2345 ...some text... >3456 ...some text... . . . . 2) *.info >1234 (7 Replies)
Discussion started by: ad23
7 Replies

9. UNIX for Dummies Questions & Answers

Renaming files

Hello! I am not familiar with UNIX and I have this problem: I need to move files from a UNIX machine to a PC. UNIX file names contain ":" as special character which is not recognized in a PC. How can I change ":" for "_" in the name of a bunch of files in UNIX? Thanks for your help. (7 Replies)
Discussion started by: Tygoon
7 Replies

10. UNIX for Dummies Questions & Answers

Help with renaming files

Anyone out there know how, in a one line UNIX Command, I could rename(mv) a file that contains variable string as part of its name. The variable string is the process instance number. For example, I'd like to be able to rename XX_XXXXX_nnnnn.pdf (where nnnnn is a number and its value depends on... (4 Replies)
Discussion started by: mc_cool_e
4 Replies
Login or Register to Ask a Question