Command to find file system details on AIX


 
Thread Tools Search this Thread
Operating Systems AIX Command to find file system details on AIX
# 1  
Old 10-07-2015
Command to find file system details on AIX

Hi ,

Could you please tell me how to find the following on AIX?

1.Command to find file system details?
2.What are all the files exist under a specific directory along with their sizes?

In general we use,

du -sh * | grep M under a directory which returns files having size of MB,
du -sh * | grep G under a directory which returns files having size of GB in Linux. But this du -sh command in not working on AIX. Similarily I am looking for similar type of command on AIX.

I hope my request is clear.

Os version -- AIX 3 5


Regards,
Maddy

Last edited by Don Cragun; 10-07-2015 at 10:20 PM.. Reason: Get rid of COLOR tags; add ICODE tags.
# 2  
Old 10-07-2015
Quote:
Originally Posted by Maddy123
Hi ,

Could you please tell me how to find the following on AIX?

1.Command to find file system details?
2.What are all the files exist under a specific directory along with their sizes?

In general we use,

du -sh * | grep M under a directory which returns files having size of MB,
du -sh * | grep G under a directory which returns files having size of GB in Linux. But this du -sh command in not working on AIX. Similarily I am looking for similar type of command on AIX.

I hope my request is clear.

Os version -- AIX 3 5


Regards,
Maddy
You've been working in these forums long enough to know that telling us something like:
Quote:
But this du -sh command in not working on AIX.
without showing us the diagnostics produced (if there are any) of the results you are getting (if there are any) makes it hard for us to help you.

Your description of what du -sh | grep '[GM]' does on a Linux system is not correct unless the directory in which you run it contains no directories. Are there any directories in the directory where you want to run these commands? Are there any sparse files in the directory where you want to run these commands? Do you not care about Terabyte sized files?

And du does not give you file system details; it gives you filesystem hierarchy disk block allocation counts. (Where the filesystem hierarchies can be single files, single directories, or multiple nested filesystems depending on the operands you give it to process.)

Would the command ls -lSd give you the data you need and would a shell or awk arithmetic comparison on field 5 of the ls output to select the file sizes you want from the output be sufficient?
This User Gave Thanks to Don Cragun For This Post:
# 3  
Old 10-08-2015
on AIX you can say either du -sm or du -sg
This User Gave Thanks to agent.kgb For This Post:
# 4  
Old 10-08-2015
Hi Don/Agent,

Thanks. I am able to list files under directories with their sizes using commands du -sm / du -sg.


Regards,
Maddy

Last edited by Don Cragun; 10-11-2015 at 07:14 PM.. Reason: Add ICODE tags.
# 5  
Old 10-09-2015
du/df -sh is a GNU aka coreutils convention. I doubt IBM will ever support "-h" and I know coreutils is not going to support "-g" - because I asked. The answer was: we have "-h".

Anyway, to summarize what you are seeing (I switched to root, because not all directories were directly readable - saving you that)

I just type the request - and it works!
Code:
michael@x071:[/home/michael]su
root's Password: 
michael@x071:[/home/michael]du -sh
1.7G    .

Some debugging - use full pathname for IBM AIX du
Code:
michael@x071:[/home/michael]/usr/bin/du -sh
/usr/bin/du: Not a recognized flag: h
Usage: du [-a | -s] [-rlkmgx] [ -H | -L ] [Name ...]

So, what am I using?
Code:
michael@x071:[/home/michael]which du
/opt/bin/du
michael@x071:[/home/michael]lslpp -w /opt/bin/du
  File                                        Fileset               Type
  ----------------------------------------------------------------------------
  /opt/bin/du
                                      aixtools.coreutils.rte        File

And, if you are interested in playing with coreutils on AIX (from AIX 5.3 TL7 and later) trying installing coreutils and gettext (GNU text internationalzation) from either aixtools (that I package), or from Perzl site.
The key difference is I package for installp and he packages from rpm

See coreutils - AIXTOOLS and gettext - AIXTOOLS - or AIX Open Source Packages | Main / coreutils

Playtime! - And hope this helps Smilie
# 6  
Old 10-11-2015
Hi Michael,

Your command is not helpful. I am unable to find answers I am looking for using your commands.Smilie

Code:
$ cd /oraarch01/tivtcprd
$ du -sh
du: Not a recognized flag: h
Usage: du [-a | -s] [-rlkmgx] [ -H | -L ] [Name ...]
$ lslpp -w /oraarch01/tivtcprd


Regards,
Maddy
# 7  
Old 10-11-2015
Sorry for the confusion then. I reply to be of assistance, not to harm.

The IBM versions of du and df do not know the option 'h' - which is the option GNU uses as a wildcard for sizes.

From the GNU man page for du:
Code:
     DU(1)           GNU coreutils 8.24 (October 2015)           DU(1)

          -h, --human-readable
               print sizes in human readable format (e.g., 1K 234M 2G)

The -w option for lslpp is to show where a command comes from (or which fileset it comes from. So, my example was to show where the commands du come from - and should have been like this - to prevent confusion!

Code:
root@x065:[/home/root]lslpp -w /usr/bin/du /opt/bin/du
  File                                        Fileset               Type
  ----------------------------------------------------------------------------
  /usr/bin/du                                 bos.rte.commands      File
  /opt/bin/du
                                      aixtools.coreutils.rte        File

Hoping this - well - helps Smilie

If you need/want support for the -h option you will need to get GNU coreutils for AIX.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

How to find the details of Fonts on AIX?

Hi, Can someone help me out, how I can find the details of the Fonts installed on AIX, details such as the font type, directory, Non-Latin Fonts like Greek, Hebrew, or Arabic, starting with Arabic Objective: Oracle Reports creates PDF on AIX we want to use ARABIC Fonts which are... (1 Reply)
Discussion started by: filosophizer
1 Replies

2. Shell Programming and Scripting

Print column details from fixed width file using awk command

hi, i have a fixed width file with multiple columns and need to print data using awk command. i use: awk -F "|" '($5 == BH) {print $1,$2,$3}' <non_AIM target>.txt for a delimiter file. but now i have a fixed width file like below: 7518 8269511BH 20141224951050N8262 11148 8269511BH... (5 Replies)
Discussion started by: kcdg859
5 Replies

3. Shell Programming and Scripting

How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix. I want to do the following task but stuck with file creation date(sysdate) Following is the requirement I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Discussion started by: PreetArul
4 Replies

4. Shell Programming and Scripting

Getting file Details with find -mmin

I'm new to this and I have done a lot of research and am 99% done with my ksh script BUT I need help with. The script looks at Journal files and reports back on any that have not been updated for 15 min. Everything works but I wanted more detail (added -ls) and now I'm getting dups. Original code:... (2 Replies)
Discussion started by: blackopz
2 Replies

5. UNIX for Dummies Questions & Answers

find command AIX

Hi all , could anyone please help with find command in AIX. I am trying to find files but there are more than 30thousand files in there.I realise I need to use xargs somehow but dunno the correct way to pull this. find /log_directory/* -prune -xdev -type f -mtime +20 | xargs ls -l the... (2 Replies)
Discussion started by: erinlomo
2 Replies

6. AIX

Command to get Disk Adapter details in AIX

Hi, What is the command to get the disk adapter performance details in AIX?. Guide me. (2 Replies)
Discussion started by: maruthu
2 Replies

7. UNIX for Advanced & Expert Users

Using SCP command in IBM AIX to download file from remote to local system

Hi, When i run the code in solaris unix machine, the file from remote server is getting downloaded. but when i use the same code in IBM AIX remote machine, it is not running. It is saying "Erro during scp transfer." Below is the code. Please give some resolution. SCPClient client = new... (1 Reply)
Discussion started by: gravi2020
1 Replies

8. UNIX for Advanced & Expert Users

How to Find AIX system parameters

System Parameters: maximum number of processes = 2048 Network parameters: ipqmaxlen - 512 rfc1323 - 1 sb_max - 1310720 (2*655360) tcp_recvspace - 65536 tcp_sendspace - 65536 Udp_recvspace - 655360 Udp_sendspace 65536 (1 Reply)
Discussion started by: R00tSc0rpi0n
1 Replies

9. UNIX for Dummies Questions & Answers

Details on the ls command and file types

Hey y'all, I need some help with the nitty gritty of the ls command. -First off in the man pages in the -l mode the first character can be "door" can anyone tell me what a door is??? -also in the -l mode the first character can be "fifo"or"pipe" can anyone tell me what a this is??? -What... (4 Replies)
Discussion started by: jacob358
4 Replies
Login or Register to Ask a Question