Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] How to cope with strange filenames in bash?
- Date: Tue, 3 Jul 2007 17:10:20 +0900
- From: baluta@example.com (Chris BALUTA)
- Subject: Re: [tlug] How to cope with strange filenames in bash?
- References: <20070703072842.GG3938@wasi.karlov.mff.cuni.cz>
- User-agent: Mutt/1.5.13 (2006-08-11)
Michal Hajek wrote: > how do I cope in bash with filenames containing "-" character (i.e. > dash) ? > In my case, I have downloaded this file: > -umai-Doremi--Kenichi-10--B36CAB67-.avi.part1.rar [brief snip] > $ mv \-umai\-Doremi\-\-Kenichi\-10\-\-B36CAB67\-.avi.part1.rar k1.rar > mv: invalid option -- m > Try `mv --help' for more information. There may well be a very simple escaping sequence that I'm missing, but one way around this is via the "find" command. ("The find Command Is Great" [1]). find . -name "*Doremi--Kenichi*" -exec mv {} k1.rar \; This assumes that you've only got one file in the current directory that has got "Doremi--Kenichi" in the name. If not, you can just spell out the file name in full in the quotes. If the file isn't in the current directory, change the "." to the directory name. The {} and the \; are both absolutely needed. -Chris [1] "UNIX Power Tools", 2nd Edition, p. 289. The book is now in its 3rd edition, at least. I'd highly advise picking up a copy as it's got great tips in there that are often perfectly good for Linux as well.
- Follow-Ups:
- Re: [tlug] How to cope with strange filenames in bash?
- From: Josh Glover
- References:
- [tlug] How to cope with strange filenames in bash?
- From: Michal Hajek
Home | Main Index | Thread Index
- Prev by Date: [tlug] The use of -
- Next by Date: Re: [tlug] Applications not starting in SUSE
- Previous by thread: Re: [tlug] How to cope with strange filenames in bash?
- Next by thread: Re: [tlug] How to cope with strange filenames in bash?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links