AIX and HP-UX equivalent of Linux stat command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AIX and HP-UX equivalent of Linux stat command
# 1  
Old 10-13-2011
AIX and HP-UX equivalent of Linux stat command

To list file permission/access right in octal format, linux has a command 'stat'. For example, we can use the followin -
Code:
stat -c %a `find . -type f

Is there any equivalent command in AIX and HP-UX to give the same result as linux 'stat' command?

Please advice.

Last edited by Franklin52; 10-13-2011 at 06:32 AM.. Reason: Please use code tags for data en code samples, thank you
# 2  
Old 10-13-2011
Quote:
Originally Posted by atanubanerji
To list file permission/access right in octal format, linux has a command 'stat'. For example, we can use the followin -
Code:
stat -c %a `find . -type f

Is there any equivalent command in AIX and HP-UX to give the same result as linux 'stat' command?

Please advice.
did you check this for is there or not.
Code:
/usr/bin/istat

# 3  
Old 10-13-2011
i use this in solaris:
Quote:
perl -le'printf "%o", 07777 & (stat)[2] for @ARGV' <file>
# 4  
Old 10-13-2011
Quote:
Originally Posted by rishav
i use this in solaris:
you can use this instead of perl Smilie
Code:
#!/bin/bash
## sunOS unix.com @ygemici ** find file/dir access rights in octal ## 
## stat_justdoit ##
tmp_=/tmp/statics_unix.com_tmp
tmp_stats_=/tmp/stats_prmx_tmp_
if [ -f "$1" ]; then ls -v "$1">$tmp_
elif [ -d "$1" ]; then ls -dv "$1">$tmp_
else echo "Parameter must be regular file or directory!!";exit 1;fi
sed -n '/^  *[013]/s/.*::*\([^ ]*\).*/\1/p' $tmp_>$tmp_stats_
calc=`sed -n "$i s/-/0_X/g;s/r/4_X/g;s/w/2_X/g;s/x/1_X/g;s/_X/+/g;s/+$//p" $tmp_stats_|bc`
recalc=`echo $calc`;echo ${recalc// /}

Code:
# touch testfile
# ls -l testfile
-rw-r--r--   1 root     root           0 Jun 10 18:26 testfile
# ./stat_justdoit testfile
644


regards
ygemici
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with stat command

Hi Experts, I am here with very simple request: #!bin/bash a=`stat -c %y log1.csv` echo $a and this stat command returning value as 2013-08-11 05:42:10.000000000 -0400: But I want to see in mm/dd/yyyy format? any help is highly appreciated thank you ---------- Post... (9 Replies)
Discussion started by: parpaa
9 Replies

2. Shell Programming and Scripting

Banner command equivalent in Linux

Hi guys can i get banner equivalent command in linux. I am using Linux xcclx0619.target.com 2.6.18-308.11.1.el5xen #1 SMP Fri Jun 15 16:19:17 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux (1 Reply)
Discussion started by: mohanalakshmi
1 Replies

3. AIX

Equalent of Linux "stat" in AIX

i would like to know the equivalent of stat -c %Y <file> command in AIX. i tried "istat" but its not giving the epoch time and also tried with perl perl -le'printf "%o", 07777 & (stat) for @ARGV' <file> it not also provding the timing . ... (3 Replies)
Discussion started by: expert
3 Replies

4. UNIX for Dummies Questions & Answers

pfiles command equivalent in Linux

May i know what is the equivalent tool in linux for pflies in solaris. ? (2 Replies)
Discussion started by: mohtashims
2 Replies

5. Solaris

solaris equivalent to the linux screen command

hi there is there a solaris equivalent to the linux screen command? (1 Reply)
Discussion started by: milhan
1 Replies

6. Shell Programming and Scripting

Equivalent command to 'stat'

Can anyone tell me which is the equivalent command to 'stats' in ksh shell which discribes the file system? Thanks in advance Regards, Im_new (6 Replies)
Discussion started by: im_new
6 Replies

7. Linux

devfsadm equivalent(sol) command in linux os

Hi frnds, what is the devfsadm(solaris) equivalent command in linux os? Thanks in Adv. Arjun Reddy. (2 Replies)
Discussion started by: arjunreddy3
2 Replies

8. UNIX for Advanced & Expert Users

Equivalent for iostat -e in AIX HP-UX Linux

iostat -e gives the soft, hard and transport error information in Solaris. What is the equivalent command in the other flavors of Unix AIX HP Linux. Thanks Prasi (1 Reply)
Discussion started by: prasi_in
1 Replies

9. Shell Programming and Scripting

Equivalent Suse Linux command

hi, In solaris, psrinfo gives number of cpu in use/online and so on. What is the equivalent command for "psrinfo" in Suse Linux ? Thx (3 Replies)
Discussion started by: braindrain
3 Replies

10. Shell Programming and Scripting

stat command

how can ý use "stat command"????.. (2 Replies)
Discussion started by: emreatlier
2 Replies
Login or Register to Ask a Question