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

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
ls -l filename | awk '{print $5}'

if in programming lang - c
use stat command on the file
  #4 (permalink)  
Old 08-22-2006
nortypig nortypig is offline
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
Closed Thread

Bookmarks

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 01:09 AM.


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