From 997abace67ab8423fcf4a2cb15c46613d6a9c89a Mon Sep 17 00:00:00 2001 From: Asocia Date: Sat, 3 Jul 2021 17:12:48 +0300 Subject: [PATCH] TIL: Looping through the files --- bash-scripting/looping-through-the-files.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 bash-scripting/looping-through-the-files.md diff --git a/bash-scripting/looping-through-the-files.md b/bash-scripting/looping-through-the-files.md new file mode 100644 index 0000000..3d03065 --- /dev/null +++ b/bash-scripting/looping-through-the-files.md @@ -0,0 +1,13 @@ +You can loop through the files with: +``` +for f in * ; do + echo $f +done +``` + +If you want to loop through only directories: +``` +for d in */ ; do + echo $d +done +```