[lug] Finding a File

Greg Seker sekerg at comcast.net
Thu May 6 11:39:55 MDT 2004


Under bash shell, the builtin command "type [NAME]" gives an indication
about how each
"[NAME]" would be interpreted (includes builtins, functions, aliases,
executable files, etc).

     >> type type
     type is a shell builtin

"-a" prints ALL places that contain [NAME] and in the order of precedence
... COOL.

     >> type -a ls
     ls is aliased to `ls -F --color=auto'
     ls is /bin/ls

     >> type -a make
     make is a function
     make ()
     {
         if [ "$USER" != "root" ]; then
             export MAKEPARAMETERS=`echo $*`;
             command make --no-print-directory --no-builtin-rules
$MAKEPARAMETERS;
         fi
     }
     make is /usr/local/bin/make
     make is /usr/bin/make

Pretty nice ... esp. when users complain certain commands are NOT working
for them like
they are for others. 9/10 times its a path difference, or function/alias
difference.

Zeke

----- Original Message ----- 
From: "Warren Sanders" <warren at sandersonline.org>
To: <slowe at frii.com>; "Boulder (Colorado) Linux Users Group -- General
Mailing List" <lug at lug.boulder.co.us>
Sent: Thursday, May 06, 2004 11:50 AM
Subject: Re: [lug] Finding a File


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Steve Lowe wrote:
>
> |Try the 'locate' command.
>
> or the 'which' command.  'which minicom' would tell you if it's in
> your path, but then just running 'minicom' would work then ;-)
>
> - --
> Warren Sanders
> Family Photo Galleries
> http://SandersOnline.org
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQFAml692/99byU+bbQRAh42AKCIphS3tdOQBtUUJ9wDPbXCZkxYVACgme5+
> AHYWlZZGxxqpDCgCHTb9t+M=
> =ITFp
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug




More information about the LUG mailing list