-
Making directory called LC
mkdir LC
Change directorycd LC
-
Creating file called test in LC dir
touch test
-
Adding sh script into test file
cat test
thencat > test
#!/bin/sh curl --head --silent https://www.google.com/
4&5&6. When executing the test file with ./test
it says Permission denied
with ls -al
it shows that the test file has not execute permission, it has read and write only
- with
sh test
- change permission
chmod +x test
then./test
-
shell knows that the file is supposed to be interpreted using
sh
as it's indicated after shebang sign#!/bin/sh
-
Making a Python file in the same way
touch testpy
cat testpy
cat > testpy
#!/bin/python2 print "Hello World" Then change permissiom in order to enable us execute the file with
./testpy
:chmod +x testpy
-
>
sign used to take the output of a program as an input to other program or coping with cat command For example:cat testpy > cpd-testpy
Thencat cpd-testpy
it shows:> #!/bin/python2 > print "hello world"
>>
sign used to append -
Using Alias to make shortcuts
alias ll='ls -alh'