ls -l output file size


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ls -l output file size
# 1  
Old 04-02-2008
ls -l output file size

Hi Guys,

I'm working on various platforms:

Solaris 8
HP Tru64
RH Linux

I'm on the HP Tru64 system and I've got to audit a particular directory for large files that are no longer being used.

If I do an ls -l I get to see the file size. I'd just like to be clear on what that file size is measured in. Is it bytes, kilobytes, or cabages?

Will it be the same for the Sol8 and Linux OSes too?

Also if someone has some tips that might make my time more efficient, I'd greatly appreciate it.

Many thanks in anticipation.

Stin
# 2  
Old 04-02-2008
Sorry for x2 post. wouldnt let me edit.

I think its in bytes, if so, would this be correct?

973 - would be 973 bytes
1,567 - 1.567 kilobytes
326,987,658 - 326.987658 megabytes
4,123,512,002 - 4.123512002 gigabytes
# 3  
Old 04-02-2008
Hammer & Screwdriver Take a look at the man pages for ls

"size in bytes"

Code:
    -l           Lists in long format, giving mode, ACL  indica-
                  tion,  number  of  links, owner, group, size in
                  bytes, and time of last modification  for  each
                  file  (see  above).  If  the  file is a special
                  file, the size field instead contains the major
                  and  minor  device numbers. If the time of last
                  modification is greater than six months ago, it
                  is  shown  in  the format `month date year' for
                  the  POSIX  locale.  When  the  LC_TIME  locale
                  category is not set to the POSIX locale, a dif-
                  ferent format of the time field  can  be  used.
                  Files  modified  within  six months show `month
                  date time'. If the file is a symbolic link, the
                  filename  is  printed  followed by "->" and the
                  path name of the referenced file.

This User Gave Thanks to joeyg For This Post:
# 4  
Old 04-02-2008
Why dont you use du -sk <filename> or * ?
then you know that on all platform you are seing size in KB...
This User Gave Thanks to vbe For This Post:
# 5  
Old 04-08-2008
Thanks guys.

And du -sk * is ideal for what I need.

Thanks gain for all replies.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ls directory size reporting byte size instead of file count

I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms. Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies

2. UNIX for Dummies Questions & Answers

Create csv with output filenames and file size

Hello All, Here is seeking a bit of help in trying to solve a problem. I am required to create a csv file as shown below: output.csv -> output_1,output_2,output_3,...,output_<N> filename1:20,filename2:30,filename3:30,...,filename<N>:30 by listing output_1, output_2,... , output<N> as... (3 Replies)
Discussion started by: vkumbhakarna
3 Replies

3. Shell Programming and Scripting

Output after a perl script gives a file with size zero.

Hi, I have a unix shell script which generates a flat file after connecting to Teradata servers to fetch tables and views and also picks up modified unix scripts from the specified paths. Later on the script calls a perl script to assign a value based on the type of object in the flat file which... (2 Replies)
Discussion started by: yohasini
2 Replies

4. Solaris

Script fails when generated output file reaches a particular size

Hi All, New to unix. Here is the problem. Running a script that extracts data from hyperion essbase and generates a file in unix. This script fails most of the times with a very low success rate. The data has increased a lot in the last few months resulting in the file being more than 2 gb. ... (2 Replies)
Discussion started by: noufalshaw
2 Replies

5. Shell Programming and Scripting

The scripts not able to make the file to size 0, every times it go back to its original size

#!/bin/sh ########################################################################################################## #This script is being used for AOK application for cleaning up the .out files and zip it under logs directory. # IBM # Created #For pdocap201/pdoca202 .out files for AOK #1.... (0 Replies)
Discussion started by: mridul10_crj
0 Replies

6. Shell Programming and Scripting

Limiting output file size

Hi guys, I want to know if there is a way to check the current size of the file that I output "stuff" to. For example, if I run a command that outputs data (like another shell script or C program) and i do something like `./a.out &> tempfile.txt` within the script, I want to be constantly... (2 Replies)
Discussion started by: solaris7
2 Replies

7. UNIX for Advanced & Expert Users

Summing file size and output

:rolleyes:Hi, I need to find the sum of size of specific files in my directory Say for ex, mydir$ ls -ltr permisssion links user group size date time filename I want to display the sum of size of filenames having pattern "TS55". Note file size in this directory is near 400 MB. mydir$... (1 Reply)
Discussion started by: ramkrix
1 Replies

8. Shell Programming and Scripting

how to make a line BLINKING in output and also how to increase font size in output

how to make a line BLINKING in output and also how to increase font size in output suppose in run a.sh script inside echo "hello world " i want that this should blink in the output and also the font size of hello world should be big .. could you please help me out in this (3 Replies)
Discussion started by: mail2sant
3 Replies

9. Shell Programming and Scripting

compare file size from a output file from a script

Hi guys, firstly I'm working on SunOS 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V240 I've made a script to compress two directory and then send them to an other server via ftp. This is working very well. Inside theis script I decide to log usefull data for troubleshooting in case of... (7 Replies)
Discussion started by: moustik
7 Replies

10. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies
Login or Register to Ask a Question