This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Thursday, November 23, 2017

for loop command for grep the particular file system from list of servers.

Double For loop command for grep the particular file system (mount point) from list of servers.

Here,
 servers       -  contains server list
 fmount        -  mount point

Run the below command. It will login to the list of server and search the mount point and print the output.

#for j in `cat servers`; do for i in `cat fmount`; do echo $j; ssh $j df -hP | grep -i $i; done; done

Modify the variable as per your needs.

No comments:

Post a Comment