The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX and filesize ndoggy020 UNIX for Dummies Questions & Answers 3 12-06-2007 12:14 PM
How to truncate as filesize? Lestat Shell Programming and Scripting 1 06-07-2005 12:24 PM
Sorting ls by filesize peter.herlihy UNIX for Dummies Questions & Answers 2 06-04-2002 05:40 PM
FileSize ??? Cameron Shell Programming and Scripting 3 05-28-2002 07:34 PM
filesize jmg5 Shell Programming and Scripting 2 02-13-2002 03:51 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2008
Registered User
 

Join Date: Nov 2007
Posts: 48
filesize

I want to know if there is any unix command to view the size of the file?

eg.
i have a directory letter
in this i have file a,b,c,d,e.

i just want to know the size of file d and not any other.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-15-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 2,501
Code:
ls -l d
Isolating just the file size is a bit of a challenge. The output from ls also depends on your locale etc; there really ought to be a separate command for getting a file's size in computer-friendly form.
Reply With Quote
  #3 (permalink)  
Old 05-15-2008
Registered User
 

Join Date: Nov 2007
Posts: 48
thanks for your reply

Can you provide some pointer to that challenge .
I really need that answer
Reply With Quote
  #4 (permalink)  
Old 05-15-2008
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 745
check if this works for you:
Code:
ls -l  filename | awk '{print $5}'
also check that stat command

Last edited by Yogesh Sawant; 1 Week Ago at 06:01 AM.
Reply With Quote
Google UNIX.COM
Reply

Tags
awk, stat

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0