first you have to get an array of whatever you want
then you want to iterate through each variable in the array
example:
var Rocks : GameObject[]; //[] means its an array of w/e, you can use it with alot of things and it's better than Array or Arraylist...
function Update(){
Rocks = gameObject.FindGameObjectsWithTag("Rocks"); // finds all GOS with tag Rocks
for(var Rock : GameObject in Rocks){//goes through each gameobject in the array Rocks
//do stuff to each object in Rocks Here.
Rock.transform.position.x += 5;
}
}