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 and shell scripting languages 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 04:14 PM
How to truncate as filesize? Lestat Shell Programming and Scripting 1 06-07-2005 04:24 PM
Sorting ls by filesize peter.herlihy UNIX for Dummies Questions & Answers 2 06-04-2002 09:40 PM
FileSize ??? Cameron Shell Programming and Scripting 3 05-28-2002 11:34 PM
filesize jmg5 Shell Programming and Scripting 2 02-13-2002 07:51 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2008
infyanurag infyanurag is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 65
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.
  #2 (permalink)  
Old 05-15-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652

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.
  #3 (permalink)  
Old 05-15-2008
infyanurag infyanurag is offline
Registered User
  
 

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

Can you provide some pointer to that challenge .
I really need that answer
  #4 (permalink)  
Old 05-15-2008
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

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

also check that stat command

Last edited by Yogesh Sawant; 07-26-2008 at 10:01 AM..
Closed Thread

Bookmarks

Tags
awk, stat

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0