From 818c37d7d7c7affadb31586807caac7852c52b47 Mon Sep 17 00:00:00 2001 From: HilolaRustamova Date: Wed, 11 Mar 2026 16:11:10 +0000 Subject: [PATCH] ls --- individual-shell-tools/ls/script-01.sh | 1 + individual-shell-tools/ls/script-02.sh | 1 + individual-shell-tools/ls/script-03.sh | 1 + individual-shell-tools/ls/script-04.sh | 1 + 4 files changed, 4 insertions(+) diff --git a/individual-shell-tools/ls/script-01.sh b/individual-shell-tools/ls/script-01.sh index 241b62f5e..044af3619 100755 --- a/individual-shell-tools/ls/script-01.sh +++ b/individual-shell-tools/ls/script-01.sh @@ -12,4 +12,5 @@ if [[ "${script_dir}" != "$(pwd)" ]]; then fi # TODO: Write a command to list the files and folders in this directory. +ls # The output should be a list of names including child-directory, script-01.sh, script-02.sh, and more. diff --git a/individual-shell-tools/ls/script-02.sh b/individual-shell-tools/ls/script-02.sh index d0a5a10f4..33e4b10bc 100755 --- a/individual-shell-tools/ls/script-02.sh +++ b/individual-shell-tools/ls/script-02.sh @@ -3,4 +3,5 @@ set -euo pipefail # TODO: Write a command which lists all of the files in the directory named child-directory. +ls child-directory # The output should be a list of names: helper-1.txt, helper-2.txt, helper-3.txt. diff --git a/individual-shell-tools/ls/script-03.sh b/individual-shell-tools/ls/script-03.sh index 781216d21..0dc1c2f8a 100755 --- a/individual-shell-tools/ls/script-03.sh +++ b/individual-shell-tools/ls/script-03.sh @@ -3,5 +3,6 @@ set -euo pipefail # TODO: Write a command which _recursively_ lists all of the files and folders in this directory _and_ all of the files inside those folders. +ls -R # The output should be a list of names including: child-directory, script-01.sh, helper-1.txt (and more). # The formatting of the output doesn't matter. diff --git a/individual-shell-tools/ls/script-04.sh b/individual-shell-tools/ls/script-04.sh index 72f3817b3..4397cf34b 100755 --- a/individual-shell-tools/ls/script-04.sh +++ b/individual-shell-tools/ls/script-04.sh @@ -20,4 +20,5 @@ echo "First exercise (sorted newest to oldest):" echo "Second exercise (sorted oldest to newest):" # TODO: Write a command which does the same as above, but sorted in the opposite order (oldest first). +ls -tr child-directory # The output should be a list of names in this order, one per line: helper-2.txt, helper-1.txt, helper-3.txt.