Differences between current version and previous revision of TwoLetterCommands.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 10 | Last edited on Thursday, January 8, 2004 2:06:45 pm | by AristotlePagaltzis | |
Older page: | version 9 | Last edited on Thursday, January 8, 2004 2:05:31 pm | by AristotlePagaltzis | Revert |
@@ -46,10 +46,10 @@
find {,/usr}/{,s}bin -type f | grep "/..$"
It looks in /bin, /usr/bin, /sbin, /usr/sbin for all files which have two letters in their name. On my Debian Woody system there are a number of ones not listed above, which are mainly just improved tools: lc is an improved wc, gw is a gnome version of 'w' (so thats a OneLetterCommand really... ;)
-''The above is wrong (or at least bad) in so many ways. It has a useless use of grep(1); find(1) can already match globs, so just tell it to look for __-name '??'__. (
It will recurse directories and find files not available for direct invocation;
at least the [GNU] find(1) has __-maxdepth__ which can be used to fix this). It will also find files without execution permission. The following is much more precise.'' --AristotlePagaltzis
+''The above is wrong (or at least bad) in so many ways. It has a useless use of grep(1); find(1) can already match globs, so just tell it to look for __-name '??'__. It will recurse directories and find files not available for direct invocation (
at least the [GNU] version of
find(1) has __-maxdepth__ which can be used to fix this). It will also find files without execution permission. The following is much more precise.'' --AristotlePagaltzis
find ${PATH//:/ } -type f -name '??' -maxdepth 1 -perm +o+x
# if you don't have a bash-ish shell you need an extra process:
find `echo $PATH | tr : ' '` -type f -name '??' -maxdepth 1 -perm +o+x