Link to home
Start Free TrialLog in
Avatar of afcnoc
afcnoc

asked on

Need to strip the last character from an awk print statement.

I have the following command that returns the % of disk space used in a partition.
ie: 5%
I need to strip the % off the string and am not sure how to do it.
The command I am using is:
df -lk | awk '{if ($6=="/"){print $5}}'
ASKER CERTIFIED SOLUTION
Avatar of medvedd
medvedd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of afcnoc
afcnoc

ASKER

Thanks for the very quick response!
Works great.