How to view specific file size in HP UX?


 
Thread Tools Search this Thread
Operating Systems HP-UX How to view specific file size in HP UX?
# 1  
Old 09-14-2014
How to view specific file size in HP UX?

Dear,

Can anyone inform me the command to view specific file size in megabyte in hp-ux?
# 2  
Old 09-14-2014
HP-UX still does at KBs.. so you have to do size/1024 to get the size in MBs or size/1024/1024 for GBs.
# 3  
Old 09-14-2014
du and df even give blocks unless -k option is given for kilobytes. A block is 512 bytes, half a kilobyte, traditionally.
Code:
du -sk file | awk '{print $1/1024}'

Code:
ls -ld file | awk '{print $5/1024/1024}'

This User Gave Thanks to MadeInGermany For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Autosys command to view jobruns for specific dates

Hello, Is there an autosys command like autorep but instead of searching based on job name, I want to search using the start or end date For example, I want to find out which jobs ran today 02/01/2016 and it would be even better if I could search either by start or end date depending on what... (0 Replies)
Discussion started by: crsuribe
0 Replies

2. Shell Programming and Scripting

Need to view command in history for specific date

hi i want to find a command in history for specific date . is it possible that i can view ?? (1 Reply)
Discussion started by: scriptor
1 Replies

3. UNIX for Dummies Questions & Answers

look for file size greater than "0" of specific pattern and move those to another directory

Hi , i have some files of specific pattern ...i need to look for files which are having size greater than zero and move those files to another directory.. Ex... abc_0702, abc_0709, abc_782 abc_1234 ...etc need to find out which is having the size >0 and move those to target directory..... (7 Replies)
Discussion started by: dssyadav
7 Replies

4. UNIX for Dummies Questions & Answers

How do you view specific columns from a space delimited text file?

I have a space delimited text file with 1,000,000+ columns? I would only like to view specific ones (let's say through 1:10), how can I do that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

5. Shell Programming and Scripting

How to view files from a specific date/day

I wan to view files in a directory of a specific date. For example a log directory has log files . I want to view the list of the files which were generated on 01-May-2011. Is there any option/proces to perform it?? (1 Reply)
Discussion started by: mady135
1 Replies

6. UNIX for Dummies Questions & Answers

Print folder size ordered by pattern value of specific file type :-) ! challenge !

Hello dear unix command line friends ! I'm looking for a simple combinaison of ls & awk (maybe grep) to print: list of folders of a directory |_ ordered by size like what I have with $ du -sk ./* | sort -rn printing that result: 8651520 ./New Virtual Machine_1 8389120 ./Redhat ... (1 Reply)
Discussion started by: holister
1 Replies

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

8. AIX

Creat a File with a Specific Size

Hi everybody, Is there a command that can create a new file with a specific size? Thanks in advance. (3 Replies)
Discussion started by: aldowsary
3 Replies

9. Shell Programming and Scripting

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... (3 Replies)
Discussion started by: nortypig
3 Replies

10. UNIX for Dummies Questions & Answers

How to test for a specific file size

Hello, In my shell program, I need to test for a specific size of a text file before it can be imported into an oracle table. If the size is less than that number, my program should stop processing. What is the correct command to do this test? Thanks! (1 Reply)
Discussion started by: GEBRAUN
1 Replies
Login or Register to Ask a Question