summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bash.html.markdown13
1 files changed, 12 insertions, 1 deletions
diff --git a/bash.html.markdown b/bash.html.markdown
index 4e1eff9e..8cf7be18 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -44,12 +44,23 @@ if true
then
echo "This is expected"
else
- echo "And is was not"
+ echo "And this is not"
fi
# Expressions are denoted with the following format:
echo $(( 10 + 5 ))
+# Unlike other programming languages, bash is a shell — so it works in a context of current directory.
+# You can list files and directories in the current directories with ls command:
+ls
+
+# These commands have options that control their execution:
+ls -l # Lists every file and directory on a separate line
+
+# Results of the previous command can be passed to the next command as input.
+# grep command filters the input with provided patterns. That's how we can list txt files in the current directory:
+ls -l | grep "\.txt"
+
# Commands can be substitued within other commands using $( ):
# The following command displays the number of files and directories in the current directory.
echo "There are $(ls | wc -l) items here."