LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do we find all the files in all directories in UNIX? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-we-find-all-the-files-in-all-directories-in-unix-4175425351/)

nishchalkarma 09-03-2012 12:45 AM

How do we find all the files in all directories in UNIX?
 
How do we find all the files in all directories in UNIX?

Wim Sturkenboom 09-03-2012 01:19 AM

//Edit:
// I just realized you mention UNIX, not Linux. So man pages are your friend.
// below was done on Ubuntu



Not sure what you mean by 'find'. ls will list files (and directories). So read man ls

Code:

ls -R /
will give you a list of all files / directories / symlinks

If you don't want directories, you can use ls -lR / and pipe the result through grep to exclude lines starting with 'd'. An example of the latter shows the directory followed by it's contents (not taken from / but from my home directory)

Code:

.:
total 148
-rw-r--r-- 1 wim  wim    455 2011-08-08 10:00 ecrypt.txt
-rw-r--r-- 1 wim  wim    179 2011-07-19 09:41 examples.desktop
-rw-r--r-- 1 wim  wim    39 2011-09-13 06:37 hallo.txt
-rw-r--r-- 1 wim  wim    52 2012-08-16 11:01 index.html
-rw-r--r-- 1 wim  wim    42 2012-08-16 11:06 index.php
-rw-r--r-- 1 wim  wim  35409 2012-08-08 11:36 installed_software
-rw-r--r-- 1 wim  wim      7 2011-08-08 11:38 jaja.txt
-rw-r--r-- 1 wim  wim      0 2012-09-03 08:27 ls2.txt
-rw-r--r-- 1 wim  wim      0 2012-09-03 08:27 ls.txt
-rw-r--r-- 1 root root  1846 2011-08-08 10:10 passwd
-rw-r--r-- 1 wim  wim  1206 2011-08-18 05:51 report.csv
-rw-r----- 1 root root  1331 2011-08-08 10:10 shadow
-rw-r--r-- 1 wim  wim  8461 2011-08-04 07:49 ufw_closed.txt
-rw-r--r-- 1 wim  wim  3277 2011-08-04 07:49 ufw_open.txt

./adinsertion:
total 12

./adinsertion/assets:
total 0
-rw-r--r-- 1 wim wim 0 2012-07-09 18:20 152019K.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:17 1616404K.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:02 1621325K.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:21 1622584K.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:20 1622608K.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:19 1622649.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:19 1622655K.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:19 1622666.mpg
-rw-r--r-- 1 wim wim 0 2012-07-09 18:02 1622718K.mpg
-rw-r--r-- 1 wim wim 0 2012-07-10 07:13 a@b.mpg
-rw-r--r-- 1 wim wim 0 2012-07-10 07:51 a@b@z.mpg
-rw-r--r-- 1 wim wim 0 2012-07-10 07:13 c@d.mpg

./adinsertion/schedules:
total 48
-rwxr-xr-x 1 wim wim 24180 2012-07-09 16:14 70940000.sch
-rwxr-xr-x 1 wim wim 23339 2012-07-09 16:14 71040000.sch

./adinsertion/scripts:
total 4

...
...
...


nishchalkarma 09-03-2012 01:33 AM

Thank you so much. One of my friend asked me & it's confusing. I will ask what the question really means?


All times are GMT -5. The time now is 11:09 PM.