Solved

Linux, how to find files with spaces embedded

Posted on 2014-01-08
2
284 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
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now