Skip to content

Commit 92daa61

Browse files
committed
cat done
1 parent 61b7f26 commit 92daa61

8 files changed

Lines changed: 9 additions & 1 deletion

File tree

individual-shell-tools/cat/script-01.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ set -euo pipefail
44

55
# TODO: Write a command to output the contents of the helper-1.txt file inside the helper-files directory to the terminal.
66
# The output of this command should be "Once upon a time...".
7+
cat ../helper-files/helper-1.txt

individual-shell-tools/cat/script-02.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ set -euo pipefail
1111
# It looked delicious.
1212
# I was tempted to take a bite of it.
1313
# But this seemed like a bad idea...
14+
cat ../helper-files/*

individual-shell-tools/cat/script-03.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ set -euo pipefail
99
# 1 It looked delicious.
1010
# 2 I was tempted to take a bite of it.
1111
# 3 But this seemed like a bad idea...
12+
cat -n ../helper-files/helper-3.txt

individual-shell-tools/cat/script-04-stretch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ set -euo pipefail
1313
# 3 It looked delicious.
1414
# 4 I was tempted to take a bite of it.
1515
# 5 But this seemed like a bad idea...
16+
cat ../helper-files/* | nl

individual-shell-tools/ls/script-01.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ fi
1313

1414
# TODO: Write a command to list the files and folders in this directory.
1515
# The output should be a list of names including child-directory, script-01.sh, script-02.sh, and more.
16+
ls

individual-shell-tools/ls/script-02.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ set -euo pipefail
44

55
# TODO: Write a command which lists all of the files in the directory named child-directory.
66
# The output should be a list of names: helper-1.txt, helper-2.txt, helper-3.txt.
7+
ls ./child-directory

individual-shell-tools/ls/script-03.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ set -euo pipefail
55
# TODO: Write a command which _recursively_ lists all of the files and folders in this directory _and_ all of the files inside those folders.
66
# The output should be a list of names including: child-directory, script-01.sh, helper-1.txt (and more).
77
# The formatting of the output doesn't matter.
8+
ls -R

individual-shell-tools/ls/script-04.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ echo "First exercise (sorted newest to oldest):"
1515

1616
# TODO: Write a command which lists the files in the child-directory directory, one per line, sorted so that the most recently modified file is first.
1717
# The output should be a list of names in this order, one per line: helper-3.txt, helper-1.txt, helper-2.txt.
18-
18+
ls -1t ./child-directory
1919

2020
echo "Second exercise (sorted oldest to newest):"
2121

2222
# TODO: Write a command which does the same as above, but sorted in the opposite order (oldest first).
2323
# The output should be a list of names in this order, one per line: helper-2.txt, helper-1.txt, helper-3.txt.
24+
ls -1tr ./child-directory

0 commit comments

Comments
 (0)