Mac Terminal: Edit Text Document
ls &gt; Applications.txt is going to list the Applications.txt file in the list.

Though I don't entirely understand all of your workflow, adding the -d flag should do the trick, by specifying *.app.

ls -d *.app &gt; Applications.txt


Just like your previous approach though, that won't catch .app files buried in subdirectories (like your Adobe Suite). You can modify find's maxdepth parameter for something like that:

find . -maxdepth 1 -type d -name "*.app" &gt; Applications.txt


If you wish to search within all subdirectories of the current one, simply omit the -maxdepth option altogether.

If you have a problem with the pathname being part of the output (e.g., you want Terminal.app not ./Utilities/Terminal.app), then try this instead:

cd /Applications
find * -type d -name "*.app" -exec basename "{}" \; &gt; Applications.txt


If you want to find any application anywhere on your Mac, try:

mdfind -interpret "kind:application"  # this is localized for your language


The mdfind command uses Spotlight's index, so it's fast, but (being an index) it may not always represent the exact, up-to-the-minute state of the filesystem. How to remove the pathname from the front is left as an exercise for the reader (hint: xargs -I{} basename "{}").