how to display paths of files in a directory


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers how to display paths of files in a directory
# 1  
Old 05-18-2009
how to display paths of files in a directory

hi guys
does anyone know how to display the file paths of the files stored within a directory at the command terminal?
e.g. if i have a directory called "home", how do i display the file paths of the files inside the directory?
cheers
# 2  
Old 05-18-2009
Code:
find ./home -print

one way.
# 3  
Old 08-19-2009
Hi,

Code:
 

$ find ./testdir -print
./testdir
./testdir/Count
./testdir/testdir.sh
./testdir/SQL
./testdir/filevalid.sh
./testdir/.hidden1
$

$ ls -ld testdir
drwxr-xr-x    6 scripter     scripterworld       4096 Aug 20 00:50 testdir
$ ls -l testdir
total 24
drwxr-xr-x    2 scripter     scripterworld       4096 Aug 19 20:16 Count
-rwxr-xr-x    1 scripter     scripterworld        342 Aug 19 23:15 filevalid.sh
drwxr-xr-x    2 scripter     scripterworld       4096 Aug 19 20:16 SQL
-rw-r--r--    1 scripter     scripterworld        307 Aug 19 20:15 testdir.sh
$ cd testdir/
$ ls -ltr
total 24
-rw-r--r--    1 scripter     scripterworld        307 Aug 19 20:15 testdir.sh
drwxr-xr-x    2 scripter     scripterworld       4096 Aug 19 20:16 Count
drwxr-xr-x    2 scripter     scripterworld       4096 Aug 19 20:16 SQL
-rwxr-xr-x    1 scripter     scripterworld        342 Aug 19 23:15 filevalid.sh
$

ls -l command with directoryname displays files in that directory

Scripter
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Apache2 does not display files inside directory

Hello, I have been running Ubuntu14.04 + apache2. 000-default.conf: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory... (5 Replies)
Discussion started by: baris35
5 Replies

2. Shell Programming and Scripting

Replace directory paths in multiple files at once

I need to update about 2400 files in a directory subtree, with a new directory path inside the files I need to change this occurence in all files: /d2/R12AB/VIS/apps/tech_st/10.1.2 with this: /u01/PROD/apps/apps_st/10.1.3 I know how to change single words using "find . -type f -print0 |... (6 Replies)
Discussion started by: wicus
6 Replies

3. Solaris

Display the number of files in a directory and recursively in each subdirectory

Display the number of files in a directory and recursively in each subdirectory To look something like below, for example /var 35 /var/tmp 56 /var/adm 46Any ideas how can we do this? Got a sun cluser global mount point which takes ages to mount everytime, need to understand... (5 Replies)
Discussion started by: jakerock
5 Replies

4. Solaris

Display the number of files in a directory and recursively in each subdirectory

Display the number of files in a directory and recursively in each subdirectory To look something like below, for example /var 35 /var/tmp 56 /var/adm 46 Any ideas how can we do this? :wall: (1 Reply)
Discussion started by: jakerock
1 Replies

5. Shell Programming and Scripting

Awk to replace directory paths

Hi all, I have written a bash script to do a few things for my Splunk deployment, however, I am currently stuck on one part... I need to the current working directory (I collect this with `pwd`) in the script as it could in theory be run from a number of locations. I'm not that great with... (5 Replies)
Discussion started by: TauntaunHerder
5 Replies

6. Shell Programming and Scripting

Unable to export Directory paths through Script

Following is the output of .profile file - $ cat /home/estdm2/.profile #!/bin/ksh set -o vi alias l="ls -ltr" umask 002 Following is the path setting script. $ cat DM_ENV_VARS_NEW.ksh #!/bin/ksh . /home/estdm2/.profile sEnv=$1 echo "We are in ${sEnv} environment" echo "STEP010... (3 Replies)
Discussion started by: sumeet
3 Replies

7. UNIX for Dummies Questions & Answers

cat a list of directory paths only to a file

Hi! I would like to funnel a series of directories and subdirectories into a text file. This is the output I would like to see from a find command: /mypath/ABC_01/VISIT_01 /mypath/ABC_01/VISIT_02 /mypath/ABC_01/VISIT_03 /mypath/ABC_02/VISIT_01 /mypath/ABC_03/VISIT_01 I've tried: find... (2 Replies)
Discussion started by: goodbenito
2 Replies

8. UNIX for Dummies Questions & Answers

Find files and display only directory list containing those files

I have a directory (and many sub dirs beneath) on AIX system, containing thousands of file. I'm looking to get a list of all directory containing "*.pdf" file. I know basic syntax of find command, but it gives me list of all pdf files, which numbers in thousands. All I need to know is, which... (4 Replies)
Discussion started by: r7p
4 Replies

9. Solaris

find home directory paths for all users

How to find al the user's home directories? (2 Replies)
Discussion started by: a2156z
2 Replies

10. Shell Programming and Scripting

Tail-alike display of new files in directory

The system I work on, produces several kinds of status-files in a single directory. I would like to be able to see the files as they are added to this directory. I was wondering if it would be possible to get a "tail -f" alike view of the ls-command, in such a way that a newly added file is... (4 Replies)
Discussion started by: rschelkers
4 Replies
Login or Register to Ask a Question