#!/bin/bash parent=$1 children=$(ls $parent) for child in $children do if [ -d $parent/$child ] then mv $parent/$child/* $parent/ fi done