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
find the specific file in unix server dsdev_123 AIX 3 03-28-2008 12:51 PM
find file size hgriva1 Shell Programming and Scripting 6 11-07-2007 01:07 AM
command to find out total size of a specific file size (spread over the server) abhinov SUN Solaris 3 08-08-2007 03:48 AM
Creat a File with a Specific Size aldowsary AIX 3 12-14-2006 08:35 AM
How to test for a specific file size GEBRAUN UNIX for Dummies Questions & Answers 1 02-20-2006 08:50 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-22-2006
Registered User
 

Join Date: Aug 2006
Location: Hobart Tasmania
Posts: 58
Find the size of a single specific file

As I'm a newbie to UNIX, very newbie in fact, could anyone humour me and tell me how I'd find just the file size in bytes for a specific file?

Or at least just the specific line from the ls -a for the file - call it file1

I know this sounds bad but I don't seem to be getting very far at this one. How does one normally go about this simple task (I want to use the file size in a calculation)
Reply With Quote
Forum Sponsor
  #2  
Old 08-22-2006
Registered User
 

Join Date: Aug 2006
Location: Hobart Tasmania
Posts: 58
sorry, i mean

Code:
ls -l file1

Last edited by nortypig; 08-22-2006 at 04:44 AM.
Reply With Quote
  #3  
Old 08-22-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
ls -l filename | awk '{print $5}'

if in programming lang - c
use stat command on the file
Reply With Quote
  #4  
Old 08-22-2006
Registered User
 

Join Date: Aug 2006
Location: Hobart Tasmania
Posts: 58
thanks for the help, I know that one was a bit of a simple question but I had so forgotten about awk for some reason
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:14 AM.


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

Content Relevant URLs by vBSEO 3.2.0