how to list a directory & file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to list a directory & file
# 1  
Old 09-26-2006
Question how to list a directory & file

Good day every body,

Iv've been given a list of files and directory requested by the Auditor's. My problem is how do i list the file with the permission given and also save the file into text.file so that i can passed the result/oucome to them?? Thanks alot guys!!
# 2  
Old 09-26-2006
Do you have the list of files in a file? If you do, just do this:
Code:
while read filename; do
   ls -l $filename
done < inputfile > outputfile.txt

# 3  
Old 09-27-2006
Hi Try this

Hi

if u are looking at the command prompt u can do the below

ls -al > test.txt

directory files will end with "/ "
where the files names doesnt end with " / " are files
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compressing & removing files in a directory & subdirectory

Hi, I want a simple line of code that will compress files within a directory specified (parameter) and its subdirectories and also i want to remove files which are exactly 365 days old from the sysdate after this compression. Please help. Thanks, JD (8 Replies)
Discussion started by: Jesshelle David
8 Replies

2. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies

3. Shell Programming and Scripting

Looping inside directories based on a file which contains file directory list

Hi All, Please help. I have got a file which contains a listing of a file and some directories after it, one by one. I am calling this file xyz.txt here file1 dir1 dir2 dir3 dir4 file2 dir5 dir6 dir7 dir8 file3 dir9 dir10 dir11 dir12 (6 Replies)
Discussion started by: Piyush Jakra
6 Replies

4. UNIX for Dummies Questions & Answers

Reading the dates from a file & moving the files from a directory

Hi All, I am coding for a requirement where I need to read a file & get the values of SUB_DATE. Once the dates are found, i need to move the files based on these dates from one directory to another. ie, this is how it will be in the file, SUB_DATE = 20120608,20120607,20120606,20120606... (5 Replies)
Discussion started by: dsfreddie
5 Replies

5. Shell Programming and Scripting

directory structure & file permisson comparison

Hi - I want to compare permissions of the directory structure and files beneath it with permissions one week back on same directory structure and files beneath it. if any changes to permissions of any file or directory permissions send an email. I am not sure how to list the permissions of all... (1 Reply)
Discussion started by: oraclermanpt
1 Replies

6. UNIX for Dummies Questions & Answers

How to search & list subdirectories with the given file name

Question: How to search & list subdirectories with the given file name? For example: The directory structure looks like; /Builds/DEV/Build_RL01/DDL/ a_tbl_cre.sql ...... /Builds/DEV/Build_RL01/DML/ a_upd.sql .... .... Requirements: 1. I need to find subdirectory DML which is... (0 Replies)
Discussion started by: Siva SQL
0 Replies

7. UNIX for Dummies Questions & Answers

WebDav/davfs mounted file & directory names in all UPPERCASE

Hey, I have a WebDav directory mounted and everything seems fine except for one thing. All file/directory names appear in all UPPERCASE, when in actual fact they are lowercase on the remote machine. For example: foo/bar/baz.html on the remote host, appears on my local machine as... (0 Replies)
Discussion started by: MrMoney
0 Replies

8. Shell Programming and Scripting

cp && rm command, rm: <file> not removed. No such file or directory

Hi, I am running this is korn shell cp $source/$fname $dest/dir && rm $source/$fname This was returned: rm: /dir/file not removed: No such file or directory The file could be found in the $dest directory which meant the cp was success. The above code is used in a for loop to move... (5 Replies)
Discussion started by: Leion
5 Replies

9. AIX

find for specific content in file in the directory and list only file names

Hi, I am trying to find the content of file using grep and find command and list only the file names but i am getting entire file list of files in the directory find . -exec grep "test" {} \; -ls Can anyone of you correct this (2 Replies)
Discussion started by: madhu_Jagarapu
2 Replies

10. UNIX for Dummies Questions & Answers

list largest files in a directory & its subdirectories

I need to find the largest files in a directory & it's subdirectories. I'm not sure what options on ls -l will work to give me this. or is there another way to do this? Thanks, igidttam (6 Replies)
Discussion started by: igidttam
6 Replies
Login or Register to Ask a Question