You are not logged in.
Pages: 1
Hello,
I'm wondering if there is a shortcut to open files from the command line, while ignoring directories. For example, "<program> <filename>" to open said file in that program. However, what about if I want to open ALL files in that directory with said program? If I type "<program> *" or "<program> ." it will open all files, but in certain scenarios, I wll receive an error message saying something along the lines of "cannot open directories in <program>." So, I was curious if there was a shorthand for opening all files in a directory, but exclude subdirectories.
Thanks,
Culley
Last edited by CulleyS (2011-02-01 23:09:51)
Offline
This will do it:
find . -maxdepth 1 -type f -exec <program> {} +
Offline
Beautiful, I was messing with find, but wasn't making any headway.
Thanks!
Offline
You're welcome.
That said, the find command might appears a bit complex at first, but once you get accustomed to it, it's a really useful tool.
Offline
Pages: 1