Skip to main content
Question

Script to find files that begin with a space


Forum|alt.badge.img+5

Hi all,

Please forgive my bash scripting ignorance, but I was wondering if one of you scripting gods could help me with a small script or command to output a list of files that start with a space character.

Using the find command or something similar is where I'm heading.

Cheers,
Gav

2 replies

Forum|alt.badge.img+5
  • Author
  • Contributor
  • 56 replies
  • June 12, 2015

Wow, how simple:

find /Users/username -name " *"

I'm going to try and output the list of files to a text file and email it to our support team as an attachment. If I manage to get this working I'll post it up. If anyone has any tips of existing scripts like this in the meantime, that would be great.

Cheers,
Gav


Forum|alt.badge.img+12
  • Contributor
  • 529 replies
  • June 12, 2015

Try:

find /Users/username -name " *" -exec echo {} > /tmp/outfile.txt ;

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings