From 8bc5cb91ff761af7b57747e11f0ec67807433570 Mon Sep 17 00:00:00 2001 From: Asocia Date: Sat, 3 Jul 2021 17:22:27 +0300 Subject: [PATCH] TIL: Moving everything one level up --- bash-scripting/moving-everything-one-level-up.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 bash-scripting/moving-everything-one-level-up.md diff --git a/bash-scripting/moving-everything-one-level-up.md b/bash-scripting/moving-everything-one-level-up.md new file mode 100644 index 0000000..7617717 --- /dev/null +++ b/bash-scripting/moving-everything-one-level-up.md @@ -0,0 +1,8 @@ +You can move every file (except the hidden ones) up by one level in the hierarchy with something like this: +``` +for d in */ ; do + mv $d* . + rmdir $d # optional +done +``` +