filesystem percentage


 
Thread Tools Search this Thread
Operating Systems Linux filesystem percentage
# 1  
Old 09-28-2008
filesystem percentage

hi guys,
im new in linux i need your help.
my problem is how can i take the % here's the sample

Available Used(%) Mounted On
1.2G 73% /var
299.3M 72% /home
520.3M 88% /home/file
164.8M 84% /home/prd
812.6M 79% /home/fmssdr

into this output

Available Used(%) Mounted On
1.2G 73 /var
299.3M 72 /home
520.3M 88 /home/file
164.8M 84 /home/prd
812.6M 79 /home/fmssdr

i try to script using "expr" its confusing
thanks

Last edited by hdroid0326; 09-28-2008 at 01:37 AM..
# 2  
Old 09-28-2008
Some possibilities:

Code:
sed 's/%//' file > newfile

or:
Code:
tr -d '%' < file > newfile

or:
Code:
awk '{sub("%","")}1' file > newfile

Regards
# 3  
Old 09-28-2008
Code:
 awk '{$2=$2+0}1' file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to monitor OS in percentage

Hi, I am looking for generic commands / scripts that could run across platforms especially on HP Itanium boxes to give me % of free OS parameters For eg: Free Total Memory RAM : 20 % Free Total Swap Memory: 35% Free Total CPU utilisation: 44% Free Disk Space: /appl = 55%... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. Shell Programming and Scripting

Percentage of occurence

Dear all, I have data like below and i need to add coloumn before the COUNT field to see the Percentage out of all COUNT field value for respective raw. ============================================= COUNT CODE sConnType tConnType... (6 Replies)
Discussion started by: Iroshan
6 Replies

3. Shell Programming and Scripting

Percentage calculation

i am trying to get percentage : but not able to do it: i tried : x=1 y=2 z=`expr $x/$y*100` it is not giving me result can u pls help on this (4 Replies)
Discussion started by: Aditya.Gurgaon
4 Replies

4. 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

5. Solaris

Solaris Filesystem vs. Windows FileSystem

Hi guys! Could you tell me what's the difference of filesystem of Solaris to filesystem of Windows? I need to compare both. I have read some over the net but it's so much technical. Could you explain it in a more simpler term? I am new to Solaris. Hope you help me guys. Thanks! (4 Replies)
Discussion started by: arah
4 Replies

6. 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

7. 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

8. UNIX for Dummies Questions & Answers

percentage

How to calculate percentage of two values in unix. (5 Replies)
Discussion started by: venkatesht
5 Replies

9. Shell Programming and Scripting

awk percentage

how would you calculate percentage by per line? Given a column of 16 lines, grab each line and divide it by the sum of the entire column and multiply by 100? thanks ... (8 Replies)
Discussion started by: rockiefx
8 Replies

10. Shell Programming and Scripting

percentage by line

hi, I am new to awk.. and getting used to the scripts. I have a small data set 5 coulms.. 16 rows. 1) I am trying to remove the percentages of each line of colum 3..like first line divided the sum of colum 3 divided by 100 and print it out. removing hte percentages of each line I would really... (3 Replies)
Discussion started by: rockiefx
3 Replies
Login or Register to Ask a Question