Sponsored Content
Full Discussion: ls -l output file size
Top Forums UNIX for Dummies Questions & Answers ls -l output file size Post 302181242 by vbe on Wednesday 2nd of April 2008 12:00:30 PM
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:
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
truncate(2)							System Calls Manual						       truncate(2)

NAME
truncate, ftruncate - Changes file length SYNOPSIS
#include <unistd.h> int truncate( const char *path, off_t length); int ftruncate( int filedes, off_t length); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: ftruncate(), truncate(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the name of a file that is opened, truncated, and then closed. The path parameter must point to a pathname which names a regular file for which the calling process has write permission. If the path parameter refers to a symbolic link, the length of the file pointed to by the symbolic link is truncated. Specifies the descriptor of a file that must be open for writing. Specifies the new length of the file in bytes. DESCRIPTION
The truncate() and ftruncate() functions change the length of a file to the size in bytes specified by the length parameter. If the new length is less than the previous length, the truncate() and ftruncate() functions remove all data beyond length bytes from the specified file. All file data between the new end-of-file and the previous end-of-file is discarded. If the new length is greater than the previous length, one byte of zero (0x00) is written at the offset of the new length. The space in between the previous end-of-file and the new end- of-file is left as a hole; that is, no blocks are allocated to the space in between the previous last block and the new last block. Full blocks are returned to the file system so that they can be used again, and the file size is changed to the value of the length parame- ter. The truncate() and ftruncate() functions have no effect on FIFO special files or directories. These functions do not modify the seek pointer of the file. Upon successful completion, the truncate() and ftruncate() functions mark the st_ctime and st_mtime fields of the file for update. If the file is a regular file, the ftruncate() and truncate() functions clear the S_ISUID and S_ISGID attributes of the file. If the file has enforced file locking enabled and there are file locks on the file, the truncate() or ftruncate() function fails. RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. If the truncate() or ftruncate() function fails, it returns a value of -1, and errno is set to indicate the error. ERRORS
The ftruncate() and truncate() functions set errno to the specified values for the following conditions: [Tru64 UNIX] The write operation failed due to an enforced write lock on the file. [Tru64 UNIX] The file has enforced mode file locking enabled and there are file locks on the file. The length parameter was greater than the maximum file size. A signal was caught during execution. The length parameter was less than 0 (zero). [Tru64 UNIX] The file is not a regular file. An I/O error occurred while reading from or writing to a file system. [Tru64 UNIX] The process' root or current directory is located in a virtual file system that has been unmounted. In addition, the ftruncate() function sets errno to the specified values for the following conditions: [Tru64 UNIX] Write access permis- sion to the file was denied. The filedes parameter is not a valid file descriptor open for writing. The fildes parameter references a file that was opened without write permission. [Tru64 UNIX] The file resides on a read-only file system. In addition, the truncate() function fails if errors occur that apply to any service requiring pathname resolution, or if one of the fol- lowing are true: A component of the path prefix denies search permission, or write permission is denied on the file. The named file is a directory. Too many symbolic links were encountered in resolving path. The size of the pathname exceeds PATH_MAX or a pathname component is longer than NAME_MAX. A component of the specified pathname does not exist, or the path parameter points to an empty string. A compo- nent of the path prefix is not a directory. The file resides on a read-only file system. RELATED INFORMATION
Functions: chmod(2), fcntl(2), open(2) Standards: standards(5) delim off truncate(2)
All times are GMT -4. The time now is 03:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy