Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to omit heading in df -k command of SunOs

Input: df -k

Output:

Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0    10332220  443748 9785150     5%    /
/devices                   0       0       0     0%    /devices
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                 45475864    1688 45474176     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
sharefs                    0       0       0     0%    /etc/dfs/sharetab
/dev/dsk/c0t0d0s3    10332220 3513927 6714971    35%    /usr

I want to omit the 1st line Filesystem kbytes used avail capacity Mounted on from the output.

I used df -k | tail -n+2 in linux to get exactly what i wanted, but in SunOs I get

zenvo% df -k | tail -n+2
usage: tail [+/-[n][lbc][f]] [file]
   tail [+/-[n][l][r|f]] [file]

How can i achieve the Required output:

/dev/dsk/c0t0d0s0    10332220  443748 9785150     5%    /
/devices                   0       0       0     0%    /devices
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                 45475864    1688 45474176     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
sharefs                    0       0       0     0%    /etc/dfs/sharetab
/dev/dsk/c0t0d0s3    10332220 3513927 6714971    35%    /usr

Note: No. of rows might change

like image 351
AabinGunz Avatar asked Jul 04 '11 12:07

AabinGunz


People also ask

What does the CLI command df do?

The df command (short for disk free) is used to show the amount of free disk space available on Linux and other Unix-like systems and to understand the filesystems that have been mounted.

What is mounted on in df command?

The df command displays information about total space and available space on a file system. The FileSystem parameter specifies the name of the device on which the file system resides, the directory on which the file system is mounted, or the relative path name of a file system.

What is PS in Solaris?

The ps command shows the process identification number (listed under PID ) for each process you own, which is created after you type a command. This command also shows you the terminal from which it was started ( TTY ), the cpu time it has used so far ( TIME ), and the command it is performing ( COMMAND ).

How do I check disk space in Solaris 10?

Use the df command to show the amount of free disk space on each mounted disk. The usable disk space that is reported by df reflects only 90 percent of full capacity, as the reporting statistics allows for 10 percent above the total available space.


1 Answers

I know it's an old thread, but the shortest and the clearest of all:

df -k | sed 1d
like image 160
Bart N Avatar answered Nov 17 '22 00:11

Bart N