listing the files without cd to the path

Hi all,

I want to check the list of all directories and links in a particular directory and here, i have the list of the directories/links which i need to print on screen.

I used the below command to check the dir/links,

cd path1 ; ls -ltd `cat dir_links_list` 

But here, i don't want to cd to that path1 where i have to check the list of dir/links. Because, there are some files have to be processed in the current path. So Without cd to the path1 directory, is there any way to get the list the all dir/links?
i guess, we can get this using find also. But there are two issues in find command.

  1. we can not pass the list of files to the find command which we need to print on screen.
  2. And find command will check recursively in the given path, but i don't want to check it in recursively, i want to check the given list dir/links in top level directory only i.e., path1 directory.

Can anyone provide the way to achieve this using find or ls commands?

Regards,
VRN

Not clear what is in dir_links_list but I think this is what you mean.

cat path1/dir_links_list | while read filename
do
      ls -lad "${filename}"
done

Ps. The word "check" is ambiguous.

sed 's#^#path1#' < path1/cat_dir_list | xargs ls -ltd

Do you 'cd path1' because dir_links_list contains relative paths? If so then there is no way to not go there. If it contains absolute paths methyl's solution works well.

Don't sell 'find' short. Here's a depth of one directory that shows only directories and links.

cat dir_list | xargs -I '{}' find {} \( -type d -o -type l \) -maxdepth 1 -printf "%p -> %l\n"

The above doesn't handle spaces well. For spaces use...

cat dir_list | xargs --delimiter="\n" -I '{}' find "{}" \( -type d -o -type l \) -maxdepth 1 -printf "%p -> %l\n"