|
|||||||||
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
linux operating commands and unix operating commands |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Command to list Files less than or equal to 2k size
Hi,
*.xml files stored on date wise folders. I need to extract *.xml files from all the folders. File size is lessthan or equal to 2K. Please let me know command or some shell program to due this job on linux m/c This is urgent, Thanks in advance - Bache Gowda |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
check out the find command. See man find and search the boards using the keyword 'find' for examples of its use.
|
| Sponsored Links | ||
|
|
|
#3
|
||||
|
||||
|
ls -l | awk '{ if ($5 < 2000) { print $0 }}'
Regards JK |
|
#4
|
||||
|
||||
|
Thanks to all,
I got the answer $find ./ -name *.xml -size -4 for less thank 2k and 4 for exactly for 2k - Bache Gowda |
| Sponsored Links | ||
|
|
![]() |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Command to list our directory size | lsy | UNIX for Dummies Questions & Answers | 5 | 03-22-2012 07:50 AM |
| How to list files which have same size? | shahril | UNIX for Dummies Questions & Answers | 3 | 11-22-2010 01:27 PM |
| list the files with size in bytes | balireddy_77 | Shell Programming and Scripting | 4 | 01-06-2009 01:17 PM |
| command to list file size | rgordon | HP-UX | 3 | 12-05-2007 05:43 AM |
| Files list which are more than 300 MB size | redlotus72 | UNIX for Dummies Questions & Answers | 2 | 09-14-2006 01:28 AM |
|
|