Solved

Linux, how to find files with spaces embedded

Posted on 2014-01-08
2
289 Views
Last Modified: 2014-01-08
I am using RHEL 6.5

I want to locate a file named  

/mnt/path/AA BB/file1

however if I do a ls on this name it gets confused because of the spaces

How can I do an ls on this file name from root

Thanks
0
Comment
Question by:Los Angeles1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39766515
ls -l "/mnt/path/AA BB/file1"

ls -l /mnt/path/"AA BB"/file1

Allow any number of characters between AA and BB (e.g. spaces):

ls -l /mnt/path/AA*BB/file1

Allow exactly one character between AA and BB (e.g. space):

ls -l /mnt/path/AA?BB/file1
0
 
LVL 48

Expert Comment

by:Tintin
ID: 39766572
or if you want to find any files with a space in their name, do

find / -type f -name "* *"
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question