Sponsored Content
Top Forums Shell Programming and Scripting listing the files without cd to the path Post 302490953 by raghu.iv85 on Wednesday 26th of January 2011 09:22:32 AM
Old 01-26-2011
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,
Code:
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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Recursive directory listing without listing files

Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories. The following command also shows the files but I only want to see the directories. ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies

2. Programming

Listing Files

Dear All, I want to list all the files of a Directory. I am not able to find out the code. So plz send me code in C in Unix Environmrnt so that I can Display all the file names of a Directory (3 Replies)
Discussion started by: krishna_sicsr
3 Replies

3. UNIX for Advanced & Expert Users

listing files excluding files from control file

I have a directory named Project.I have a control file which contains valid list of files.I would like list the files from directory Project which contains files other than listed in the control file. Sample control file: TEST SEND SFFFILE CONTL The directory contains followign... (15 Replies)
Discussion started by: ukatru
15 Replies

4. UNIX for Dummies Questions & Answers

listing certain files

How would i list the files that begin with a and end with .erc with 4 characters between (5 Replies)
Discussion started by: trob
5 Replies

5. UNIX for Dummies Questions & Answers

Listing files with full path

Hi, I need to store all the files in a directory to a text file with its full path. The example below can explain: ./File1.txt ./File2.txt ./Folder1/File11.txt ./Folder1/File12.txt ./Folder1/Folder11/File111.txt ./Folder2/file21.txt : : The ls -R1 command won't give the result as... (5 Replies)
Discussion started by: r_sethu
5 Replies

6. Shell Programming and Scripting

perl script for listing files and mailing the all files

Hi, I am new to perl: I need to write perl script to list all the files present in directory and mail should be come to my inbox with all the files present in that directory. advanced thanks for valuable inputs. Thanks Prakash GR (1 Reply)
Discussion started by: prakash.gr
1 Replies

7. Shell Programming and Scripting

Help with listing given files in a given directory path

hello every one, i'm a novice in the field of Linux, so please help me out with this problem. a text file with the following syntax is given: file1 file2 file3 file4 file5 a script is to be written to list all d file names and tar the files with the filename... (3 Replies)
Discussion started by: Amruthesh C
3 Replies

8. Windows & DOS: Issues & Discussions

DOS Dir - listing of full path and timestamp

Hi, (Apologies, I'm sure I'm not the first person to raise this question but so far in my searches haven't found a good answer). I would like to output a listing per line of filename (including full path) and 'last updated' timestamp. e.g: Z:\dir1\file1.txt 01/02/2010 10:43... (5 Replies)
Discussion started by: GM_AIX
5 Replies

9. Shell Programming and Scripting

Listing the file name and no of records in each files for the files created on a specific day

Hi, I want to display the file names and the record count for the files in the 2nd column for the files created today. i have written the below command which is listing the file names. but while piping the above command to the wc -l command its not working for me. ls -l... (5 Replies)
Discussion started by: Showdown
5 Replies

10. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies
link(2) 							System Calls Manual							   link(2)

NAME
link() - link to a file SYNOPSIS
DESCRIPTION
The system call creates a new link (directory entry) for the existing file. path1 points to a path name naming an existing file. path2 points to a path name naming the new directory entry to be created. RETURN VALUE
Upon successful completion, returns zero. Otherwise, it returns -1 and sets (see errno(2)) to indicate the error. ERRORS
The system call fails and no link is created if one or more of the following is true: A component of either path prefix denies search permission. The requested link requires writing in a directory that does not permit writing. The user's or group's disk quota block limit has been reached for this file system. The link named by path2 exists. path points outside the allocated address space of the process. The reliable detection of this error is implementation dependent. Too many symbolic links were encountered in translating either path name. The maximum number of links to a file would be exceeded. Either the specified path exceeds bytes, or a component of either specified path exceeds while is in effect. The file named by path1 does not exist. A component of either path prefix does not exist. path2 points to a null path name. path1 or path2 is null. The directory to contain the file cannot be extended. A component of either path prefix is not a directory. The file named by path1 is a directory and the effective user ID is not a user who has appropriate privileges. Some file systems return this error whenever path1 names a directory, regardless of the user ID. The requested link requires writing in a directory on a read-only file system. The link named by path2 and the file named by path1 are on different logical devices (file systems). SEE ALSO
cp(1), link(1M), symlink(2), unlink(2), symlink(4), privileges(5). STANDARDS CONFORMANCE
link(2)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy