I have a directory
foo/ bar.txt baz.yzw wun/ a.out
Now, I would like to basically add a directory in between, i.e. I would like to make it
foo/ var1/ bar.txt baz.yzw wun/ a.out
with the intent of also adding other stuff to
foo, but kept separate from the old contents.
I could of course do it like this:
$ mkdir foo-new $ mv foo foo-new $ mv foo-new foo
$ cd foo $ mkdir var1 $ mv $(ls | grep -v var1) var1
but both seem inelegant and are error-prone.
Is there a better way to do it?