how to grep filenames and sizes?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to grep filenames and sizes?
# 1  
Old 06-09-2008
how to grep filenames and sizes?

How to grep names and sizes of files in a directory by month and output to a file?

ex:
file1 | size1
file2 | size2
...
...
so on
# 2  
Old 06-09-2008
ls -l |awk '{print $8 " | " $5}'
# 3  
Old 06-10-2008
ls -l | grep -w "Jun" | awk '{printf("%50s %10d", $9,$5);}'
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Partition Sizes

Good Morning, What's a good way to get partition/slice sizes down to the byte on Solaris 9? I've tried a few ways, but only see results like 8.21GB which rounds the number. Thanks! (5 Replies)
Discussion started by: Stellaman1977
5 Replies

2. Shell Programming and Scripting

Grep and replace multiple strings in a file with multiple filenames in a file

Hi, I have a file containing list of strings like i: Pink Yellow Green and I have file having list of file names in a directory j : a b c d Where j contains of a ,b,c,d are as follows a: Pink (3 Replies)
Discussion started by: madabhg
3 Replies

3. UNIX for Advanced & Expert Users

df vs du for directory sizes

Is it better to use df or du to calculate directory sizes? I tried both and got different numbers with both. $ du -h /home 1.7G /home/bob1 1.7G /home $ df -h /home Filesystem Size Used Avail Use% Mounted on /dev/mapper/VG-lv_home 25G 1.9G 22G ... (2 Replies)
Discussion started by: cokedude
2 Replies

4. Shell Programming and Scripting

Perl - grep issue in filenames with wildcards

Hi I have 2 directories t1 and t2 with some files in it. I have to see whether the files present in t1 is also there in t2 or not. Currently, both the directories contain the same files as shown below: $ABC.TXT def.txt Now, when I run the below script, it tells def.txt is found,... (5 Replies)
Discussion started by: guruprasadpr
5 Replies

5. UNIX for Dummies Questions & Answers

Help with grep - not showing filenames

Hello, I'm looking for a search string within about 50 files but when the string is found it doesn't tell me in which member it has been found. Any ideas how I can do this? Cheers Rob (4 Replies)
Discussion started by: Grueben
4 Replies

6. AIX

How to grep filenames from a file in other files?

Hi, We have a file called applcust.txt where we keep records of our customizations in the following format. We want to verify whether the file, which is in 3rd column in this file is there in another file called patch999999.log to find out if any of our customization has got overwritten by the... (2 Replies)
Discussion started by: sshah1001
2 Replies

7. Shell Programming and Scripting

Help with file sizes

I have 2 big files in the size of gb. They are same with respect to content, both are “,” delimited. Now both of them are created by two different processes but has the same logic. The problem is they are differing only in few bytes for e.g one file is 202195751 bytes other is 202195773. So... (2 Replies)
Discussion started by: dsravan
2 Replies

8. UNIX for Dummies Questions & Answers

Directories sizes

Hello everyone, can anybody help me in finding a way to obtain a list of all the directories and their sizes. I would like to be able to run this and obtain an output like a tree structure with each branch saying how much space it is taking up . Hope you can point me in the right direction.... (1 Reply)
Discussion started by: gio001
1 Replies

9. Shell Programming and Scripting

how to grep all the filenames in a script

hello, we have a script (let say ABC) which contains the below: lp -d lp06 -t 'REPORT FOR FINANCE -FIN-' $daily/FINRPT lp -d lp06 -t 'REPORT FOR FINANCE -FIN1-' $daily/FINRPT1 lp -d lp06 -t 'REPORT FOR HUMAN RESOURCE -HR-' $dd_daily/HRRPT lp -d lp06 -t 'REPORT FOR MANAGEMENT -MGM-'... (10 Replies)
Discussion started by: newbie168
10 Replies

10. UNIX for Dummies Questions & Answers

Directory sizes

Can someone tell me how to read these damn sizes. i mean, i prefer to see sizes in MB but that is not the case when you do an ls -l on directories. i have a had time converting these to MB just for verification purposes, what would a directory size like this = 3499990308 represent in MB or... (3 Replies)
Discussion started by: TRUEST
3 Replies
Login or Register to Ask a Question