error in displaying filesystem %


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu error in displaying filesystem %
# 1  
Old 01-27-2012
error in displaying filesystem %

Hi,

The below command is expected to display the filesystem along with the used % and available % in each of the filesystem in the linux box.

Code:
df -k / | grep -v 'capacity' | gawk '{ print $5 }'

But instead of displaying the actual used %, it is showing as 'Use%'.

Could anyone please let me know how to rectify this error?

Last edited by DukeNuke2; 01-27-2012 at 02:47 PM..
# 2  
Old 01-27-2012
Why the/

why the / in
Code:
df -k /

without that, you get a list of percent entries.
# 3  
Old 01-27-2012
Please post the unfiltered output from:
Code:
df -k /

Bet it's got headings different from your "grep -v".

Please also post your expected output (your post mentions the filesystem name and two percentage figures but the "gawk" only selects one column).

Last edited by methyl; 01-27-2012 at 07:58 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ls command in a for loop displaying error

I have a few files inside a directory and in my code i am listing the files to get the filenames and do further operations.Details are given below: Dirname is taken as argument in $3 and filenames in variable $file Directory name =$3= /tmp/to-be_parsed/input Filename= $file=... (8 Replies)
Discussion started by: Jag02
8 Replies

2. UNIX for Dummies Questions & Answers

Find Null values in Columns and fail execution by displaying error message

Hi All, I am new to shell scripting. I have a requirement as part of my job to find out null/empty values in column 2 and column 3 from a CSV file and exit the further execution of script by displaying a simple error message. I have developed a script to do this by reading various articles... (7 Replies)
Discussion started by: tpk
7 Replies

3. AIX

Mount Filesystem in AIX Unable to read /etc/filesystem

Dear all, We are facing prolem when we are going to mount AIX filesystem, the system returned the following error 0506-307The AFopen call failed : A file or directory in the path name does not exist. But when we ls filesystems in the /etc/ directory it show -rw-r--r-- 0 root ... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

4. UNIX for Dummies Questions & Answers

hwo to find shared filesystem and local filesystem in AIX

Hi, I wanted to find out that in my database server which filesystems are shared storage and which filesystems are local. Like when I use df -k, it shows "filesystem" and "mounted on" but I want to know which one is shared and which one is local. Please tell me the commands which I can run... (2 Replies)
Discussion started by: kamranjalal
2 Replies

5. Solaris

Filesystem - error when extend the filesystem

Hi all, currently , my root filesystem already reach 90 ++% I already add more cylinder in the root partition as below Part Tag Flag Cylinders Size Blocks 0 root wm 67 - 5086 38.46GB (5020/0/0) 80646300 1 swap wu 1 - ... (11 Replies)
Discussion started by: SmartAntz
11 Replies

6. AIX

shrinking filesystem error

Hi Guys, probably a standard issue, so what do I miss here? Error message: > chfs -a size=-128M /export/nim/aix/5300-10 chfs: 0506-964 There is not enough free space to shrink the file system. df shows 0.75GB free > df -g . Filesystem GB blocks Free %Used Iused %Iused... (7 Replies)
Discussion started by: raba
7 Replies

7. UNIX for Dummies Questions & Answers

Displaying Filesystem During df

I'm unsure about the topic title, but this is what I want to do. I have a directory, named /opt/extra and and I want it to be displayed when I issue df command. Just by using df only, not df /opt/extra. OS: Solaris 10 Current df output root@jebat10 # df -k Filesystem kbytes ... (3 Replies)
Discussion started by: Olli.Lang
3 Replies

8. Solaris

[help] filesystem error on solaris 10

Hi All, please help me about filesystem error on sun fire 245 sparc solaris 10, i have installed solaris 10 os on sun fire 245 and done with mirroring disk. but after reboot the server i having this error below shown by system : checking ufs filesystems /dev/md/rdsk/d60: is logging.... (4 Replies)
Discussion started by: bucci
4 Replies

9. UNIX for Advanced & Expert Users

displaying error while automating ftp

#!/bin/sh HOST=HOST_IP USER=$USER PASSWD=$PASSWD FILE="*.htm" ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD get $FILE quit END_SCRIPT exit 0 Is there any way to display appropriate error message if the file is not found on the server...... (2 Replies)
Discussion started by: bishweshwar
2 Replies

10. BSD

mounting filesystem error

I get error that I have to rund fsck manually on my filesystem, but when I go to run fsck on filesystem ad1s1e I get an error that says can't open device not configured so fsck won't rund on that filesystem. I am only booting up in single user mode. I noticed when I look in the fstab file the... (1 Reply)
Discussion started by: rbizzell
1 Replies
Login or Register to Ask a Question