Click to See Complete Forum and Search --> : ls on a single symlink


JavaCowboy
08-08-2003, 10:29 AM
Is there an ls command that I can run on a single symlink to show me the destination of that symlink.

For example:

lrwxr-xr-x 1 smith cc7615 43 Jul 29 15:40 java_import -> /usr/dev/src/dataimport_src

Instead of having to type ls -la to get the info on all files/directories/symlinks for the directory I'm in, or the directory referred to by the symlink, I'd like to be able to type:

ls -{letter of option}

and have *only* this displayed:

lrwxr-xr-x 1 smith cc7615 43 Jul 29 15:40 java_import -> /usr/dev/src/dataimport_src

I looked in the manpage for ls, and I couldn't find anything.

Hayl
08-08-2003, 10:33 AM
ls -l | grep java_import

OR

ls -l java_import

JavaCowboy
08-08-2003, 10:38 AM
Actually, there's a subtle difference:

ls -la java_import

will give me the symlink

ls -la java_import/

will give me the contents of the directory being symlinked.

Removing the / made it work.


Originally posted by Hayl
ls -l | grep java_import

OR

ls -l java_import