LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-03-2012, 01:45 AM   #1
nishchalkarma
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Rep: Reputation: Disabled
How do we find all the files in all directories in UNIX?


How do we find all the files in all directories in UNIX?
 
Old 09-03-2012, 02:19 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
//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

...
...
...

Last edited by Wim Sturkenboom; 09-03-2012 at 02:22 AM.
 
1 members found this post helpful.
Old 09-03-2012, 02:33 AM   #3
nishchalkarma
LQ Newbie
 
Registered: Sep 2012
Posts: 2

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script to find new files and copy them into different directories brunoschwartz Linux - Newbie 1 10-29-2010 08:38 PM
FIND: Only directories which contain specific files brian.m Linux - General 2 05-07-2009 10:25 PM
Script to find duplicate files within one or more directories peter88 Linux - General 6 12-10-2006 06:17 AM
find and copy files into multiple directories avargas22 Linux - Newbie 2 04-01-2004 12:11 PM
Find files, directories that are own by specific user mikeshn Linux - General 2 02-12-2004 04:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration