I'm trying to remove double spaces and replace them with just one. So far I've tried: sed -i 's/ / /g' ... sed -i 's/[[:space:]][[:space:]]*/ /g' ... tr -s ' ' But none work. Then when I go to the file, those whitespaces I want to remove actually require two presses of an arrow key to move over...