LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-20-2013, 11:18 AM   #1
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Rep: Reputation: 13
Broken File Names


I've got a few file names that are broken.
Code:
ls
Shows this:
Code:
- - 200mph - Street - Race - ♛ - ✔ ~~★~SPECTACULR~TT~★~~ ✔  Isle_of_Man_TT-.mp4
But if I do the following or try do anything with that file I get this
Code:
ls *mp4
or
Code:
ls "- - 200mph - Street - Race - ♛ - ✔ ~~★~SPECTACULR~TT~★~~ ✔  Isle_of_Man_TT-.mp4"
I get this:
Code:
ls: invalid option -- ' '
Try `ls --help' for more information.
I'm grateful for any suggestions
 
Old 08-20-2013, 11:23 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,774

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Use -- to separate options from file names:
Code:
ls -- *mp4
# or
ls -- "- - 200mph - Street - Race - ♛ - ✔ ~~★~SPECTACULR~TT~★~~ ✔  Isle_of_Man_TT-.mp4"
 
1 members found this post helpful.
Old 08-20-2013, 11:32 AM   #3
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by ntubski View Post
Use -- to separate options from file names:
Code:
ls -- *mp4
# or
ls -- "- - 200mph - Street - Race - ♛ - ✔ ~~★~SPECTACULR~TT~★~~ ✔  Isle_of_Man_TT-.mp4"
Thank you, it works. I didn't have any though options. I'm confused as to *why* it works?
 
Old 08-20-2013, 12:21 PM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,774

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by NotAComputerGuy View Post
I didn't have any though options. I'm confused as to *why* it works?
Your file started with a "-", anything starting with a "-" is an option. Another method is to name the file without a leading "-":

Code:
ls "./- - 200mph - Street - Race - ♛ - ✔ ~~★~SPECTACULR~TT~★~~ ✔  Isle_of_Man_TT-.mp4"
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Listing file names side by side with directory names anon84 Linux - Newbie 3 04-03-2012 10:13 AM
Bash: bash file names are different than openbox trash file names whatthefunk Programming 4 02-15-2011 01:52 AM
[SOLVED] How to changing same file names by their directory names? bayaraa_u Linux - General 3 04-09-2010 08:26 AM
Long file names on Linux file server jumbled when opening on 16-bit PC program. brandonhughesj General 3 03-04-2009 07:53 AM
Need to find if a matching file exist from a list of possible file names wit_273 Linux - General 5 10-25-2007 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration