summaryrefslogtreecommitdiff
path: root/bash/list_all_file.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bash/list_all_file.sh')
-rwxr-xr-xbash/list_all_file.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/bash/list_all_file.sh b/bash/list_all_file.sh
new file mode 100755
index 0000000..c9d8831
--- /dev/null
+++ b/bash/list_all_file.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env sh
+
+######################################################################
+# @author : Garhve (garhve@gmail.com)
+# @file : p
+# @created : Friday Nov 04, 2022 19:22:17 CST
+#
+# @description :
+######################################################################
+
+
+function list() {
+ for x in "$1"/*; do
+ if [ -d "$x" ]; then
+ echo "$x";
+ list "$x"
+ else
+ echo "$x"
+ fi
+ done
+}
+
+list "$1"