Typically if I need to find a file while my Mac is connected to a network volume, I can easily search that volume using the Finder. This usually works well, and I can find what I need. This doesn’t work at all for the Windows shares I have to use at work.

It’s a full-on Windows environment at work, and everyone has a Windows machine on their desk. I’m the only one who uses a Mac as their primary computer. I do all my own support, which is fine. I just have to find my own workarounds sometimes.

ls -laR

Since I often have to look through one of the Windows shares for old files, I’m stuck browsing since I cannot search, so I originally went into the terminal and did a ls -laR and dumped it to a file so I could easily search for specific files. This sort of worked, but since the listing via ls lists the directory and then all the files in the directory, I had to look at more than a single line of text to find the path to the file I wanted.

find $PWD

I then found the power of combining find with $PWD for find $PWD. This allowed me to list every single file on the Windows share, and dump it all to a file (which is 18MB) that I can easily grep in about a second.

The file’s information isn’t real-time, but I’m typically not looking for new files, but old files that someone else created years ago. I can always refresh my local store every week or so.

If I need to find every Arduino sketch, it’s now as easy as egrep -i '\.ino' ~/WindowsShare.txt

Comments are closed.

« | »

buy the button:

Buy The Button