Bash
WIP Bash
echo print
&& and
; both command in the same line will
|| or
exit codes
$ last commands
./ current directory
Ex.
echo "Hello world"
> Hello world
echo $?
> 0 #exit codes successful
> 1 #exit codes not successful anything is not 0
Command substitution
var_1=$("Test") # no space
var_2=${Test2}
echo "test $var_1"
echo "test $var_2"
Trivia
cat lorem_ipsum
Pipe
Symbol |
Function
function name_of_function(){
return
}
Give permission to the file
chmod +x filename.sh
./filename.sh #type this in the command
grep is used for search
can be used with the pipe command
-c count command
-v not in
-r recursive
-C context
-A after
-B before
-rni recursive, line number
time to count