Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 439
  • Last Modified:

Search for specific file or text on an external mapped drive

I am looking for a script or command to search for specific text which is either in a file name or within documents, however it's on a mapped external drive on a MAC.
0
100questions
Asked:
100questions
  • 4
  • 3
4 Solutions
 
Britt ThompsonSr. Systems EngineerCommented:
You need to add the mounted drive to the search results list in your spotlight preferences so it will index the share. Then, you can search using Spotlight.

If you require a script you can just use grep -lir "search string" /path to search for files with the search string.
0
 
100questionsAuthor Commented:
How do I find out what the path is of the mapped external drive?
0
 
Britt ThompsonSr. Systems EngineerCommented:
you can open the terminal and type ls /volumes and see a list of all the drives. Or, you can drag the volume into the terminal window for a correctly formatted path (you can also drag specific folders from the volume to search into the terminal window for the full correctly formatted path).
0
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

 
100questionsAuthor Commented:
This is an external drive connected wirelessly, and it's showing up under the SHARED heading in finder.

When I try to drag it to the Terminal Window nothing happens, and when I type ls/ volumes, that drive is not listed.
0
 
Britt ThompsonSr. Systems EngineerCommented:
Ah, i forget you always have to show the drive on the desktop. If your finder preferences and check to show connected servers you will have a drive that shows up on the desktop.

screen cap
Then, you must actually go the item that shows under the shared list and actually open the share before the disk will mount on the desktop. IE, go in there and look at the list of files.

Then, you can drag the disk from the desktop into the terminal window. As it stands now, you're not actually connected to the share on the device.
0
 
100questionsAuthor Commented:
Thanks. I tried this, however how do I know it's searching?  Does it take a while?
0
 
Britt ThompsonSr. Systems EngineerCommented:
Yes, it will take some time and start listing files it finds. How long it takes depends on the speed of the connection and the number of files.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now