LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 05-31-2012, 11:52 AM   #1
anadem
LQ Newbie
 
Registered: Sep 2008
Posts: 16

Rep: Reputation: 0
Question how to get a file listing including subdirs, with sizes plus fully-qualified names


find can give me a list of fully-qualified names, but doesn't provide size info
ls can give me a list of file sizes, but the names are not FQN
how can i get a list that has both size and fully-qualified names of all files including those in subdirectories?

E.g. something like this (though I don't need any info except name and size; permissions, owner, etc are not essential & can be cut later):

Code:
-r--r--r--  1 root root  21K May 31 01:35 ./current/apache/httpd.conf
-rw-r--r--  1 root root 1.5K May 31 01:35 ./current/apache/server.crt
-rw-r--r--  1 root root  887 May 31 01:35 ./current/apache/server.key
-rw-r--r--  1 root root  237 May 31 01:35 ./current/apache/httpd.virtualhost.conf
-rw-r--r--  1 root root  78K May 31 01:35 ./current/etc/mibs/RFC1213-MIB.txt
-rw-r--r--  1 root root  61K May 31 01:35 ./current/etc/mibs/APPACCELERATION-STATUS-MIB.txt
-rw-r--r--  1 root root  39K May 31 01:35 ./current/etc/mibs/SNMP-USER-BASED-SM-MIB.txt
-rw-r--r--  1 root root  38K May 31 01:35 ./current/etc/mibs/SNMPv2-TC.txt
thanks!
 
Old 05-31-2012, 12:00 PM   #2
xjonquilx
Member
 
Registered: Jul 2011
Location: FL, USA
Distribution: Linux Mint 13
Posts: 169

Rep: Reputation: Disabled
The command you're looking for is ls -l.


[root@jonquil ~]# ls -l
total 16
-rw-------. 1 root root 923 May 30 17:56 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 May 30 19:49 Desktop
-rw-rw-r--. 1 root root 5283 May 29 20:20 el_dlurls.txt

---------- Post added 05-31-12 at 01:01 PM ----------

Also if you want to list hidden files add an a to that.


[root@jonquil ~]# ls -la
total 80
dr-xr-x---. 10 root root 4096 May 31 11:07 .
dr-xr-xr-x. 19 root root 4096 May 31 10:45 ..
-rw-------. 1 root root 923 May 30 17:56 anaconda-ks.cfg
-rw-------. 1 root root 442 May 31 07:37 .bash_history
-rw-r--r--. 1 root root 18 Jan 14 16:25 .bash_logout
-rw-r--r--. 1 root root 176 Jan 14 16:25 .bash_profile
-rw-r--r--. 1 root root 176 Jan 14 16:25 .bashrc
drwx------. 3 root root 4096 May 30 17:57 .cache
drwx------. 4 root root 4096 May 30 19:49 .config
-rw-r--r--. 1 root root 100 Jan 14 16:25 .cshrc
drwx------. 3 root root 4096 May 30 17:57 .dbus
drwxr-xr-x. 2 root root 4096 May 30 19:49 Desktop
-rw-rw-r--. 1 root root 5283 May 29 20:20 el_dlurls.txt
drwxr-xr-x. 3 root root 4096 May 30 19:49 .gnome2
drwxr-xr-x. 3 root root 4096 May 30 21:20 .local
drwxr-----. 3 root root 4096 May 30 18:00 .pki
-rw-r--r--. 1 root root 129 Jan 14 16:25 .tcshrc
drwx------. 3 root root 4096 May 30 19:49 .thumbnails
-rw-------. 1 root root 52 May 31 11:07 .xauthQD4jER

I don't know how to show the full directory listing, though.

Last edited by xjonquilx; 05-31-2012 at 12:04 PM.
 
Old 05-31-2012, 12:21 PM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,009

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
How about:
Code:
find /path/to/start -printf "%p %s\n"
 
1 members found this post helpful.
Old 05-31-2012, 12:49 PM   #4
anadem
LQ Newbie
 
Registered: Sep 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by grail View Post
How about:
Code:
find /path/to/start -printf "%p %s\n"
Perfect, many thanks! (I did man find but didn't see %p %s)
 
  


Reply

Tags
file, file size



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
squid fully qualified hostname DutchBoy Linux - Software 2 09-08-2004 10:17 PM
Fully qualified hostname gubak Linux - Newbie 8 07-23-2004 11:56 PM
Fully Qualified Domain Name tumana Linux - Networking 4 06-10-2004 02:58 AM
Apache fully qualified somain name? tharris Linux - Networking 2 09-02-2003 10:09 AM
Fully Qualified Domain Names? MasterC Linux - Networking 7 05-19-2003 01:38 PM

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

All times are GMT -5. The time now is 05:56 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
Open Source Consulting | Domain Registration