The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Renaming Files abch624 UNIX for Dummies Questions & Answers 2 03-20-2008 12:35 AM
Renaming files Tygoon UNIX for Dummies Questions & Answers 7 01-06-2008 10:59 PM
Renaming files whatsup Shell Programming and Scripting 8 07-10-2006 05:47 PM
Help with renaming files mc_cool_e UNIX for Dummies Questions & Answers 4 01-13-2006 04:18 PM
renaming the files adurga UNIX for Dummies Questions & Answers 1 03-17-2005 09:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-05-2009
govindts govindts is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 61
renaming files

Hello,

I wanted to rename one file where filename contains space.. How can i rename in unix?

The file name is ABC XYZ.TXT

I wanted to rename this file as ABCXYZ.TXT.

Any help is greatly appreciated...

Regards.
  #2 (permalink)  
Old 01-05-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,546
Depends on what you have in that directory....
check:
ls -al ABC*.TXT| wc -l
Gives you how many files?

Have you tried
Code:
mv ABC?XYZ.TXT  ABCXYZ.TXT
Theres many options... (with sed for example..)
  #3 (permalink)  
Old 01-05-2009
govindts govindts is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 61
Thanks.. It helps..
  #4 (permalink)  
Old 01-06-2009
RahulJoshi's Avatar
RahulJoshi RahulJoshi is offline
Registered User
  
 

Join Date: Aug 2008
Location: PUNE
Posts: 98
use below code:
Quote:
mv "ABC XYZ.TXT" ABCXYZ.TXT
  #5 (permalink)  
Old 01-06-2009
tsurko tsurko is offline
Registered User
  
 

Join Date: Jun 2007
Location: Sofia, Bulgaria
Posts: 35
Or just escape the space:
Code:
mv ABC\ XYZ.TXT ABCXYZ.TXT
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0