Show the contents of the current directory.
ls
Flags
-l
: long format-a
: show hidden files-t
: sort by time modified, recently modified first-R
: recursively show subdirectoriesUsage
ls -al
atom .
: Open current directory in Atomcode .
: Open current directory in Visual Studio Codecode <directory>
: Open directory in Visual Studio Codeopen <directory>
: Open directory in Findernode (.*).js
: Run javascript file in bashhttps://tecadmin.net/tutorial/bash-scripting/bash-command-arguments/
tail -f <log-file>
cat file.txt | grep "title"
#!/bin/sh
for x in dog elephant fish; do
echo $x
done
#!/bin/sh
if [ $1 = hotdog ]; then
echo "You typed hotdog"
else
echo You did NOT type Hotdog
echo it was '"'$1'"'
fi
#!/bin/sh
#
# This program is going to be awesome
echo "Progam is starting..."
ls -la