This is a series of exercises. Some give you a specific task to do, while others are open-ended, We highly recommend you to try them out.
for this tutorial you you need a Unix shell like bash or zsh, if you are on Linux , you don't have to do anything for windows you can use Windows Subsystem for Linux or a Linux virtual machine to use Unix-style command-line tools.
- make a directory called
LC
in your home dir - use
touch
to create a new file calledtest
in yourLC
dir - write the following into that file
#!/bin/sh curl --head --silent https://www.google.com/
The first line called shebang
(look it up !)
what is sh
? how it is different from bash
? look it up and you can try something like fish
or zsh
-
Try to execute the file, i.e. type the path to the script
(./test)
into your shell and press enter. Understand why it doesn’t work by consulting the output ofls
(hint: look at the permission bits of the file). is it executable ? -
Run the command by explicitly starting the
sh
interpreter, and giving it the file test as the first argument, i.e.sh test
. Why does this work, while ./test
didn’t? -
Look up the
chmod
program (e.g. useman chmod
). -
Use chmod to make it possible to run the command
./test
rather than having to typesh test
. How does your shell know that the file is supposed to be interpreted usingsh
? -
make a python file called
testpy
, in the same manner make the file print "hello world" when executing it./testpy
-
what is the diiference between
>
and>>
explain with exapmles -
we talked about aliases. it is very common to alias
ll
tols -alh
How can you do it ?
Note : This is a markdown file , it is very easy to use, search how to use it.
- Follow this
tmux
tutorial
oprional then learn how to do some basic customizations following these steps.
- explore the
fzf
program you can easily install it with apt runfzf
what does it do ?
you can do alot of things check this tutorial
-
try running
apt install vim
problem right ? so after it runsudo !!
what just happen, try to guess and search for it , try!15
-
run
histroy
what does it do ? search for advanced usage. how aboutcat ~/.bash_history
what does this file contain? finally pressctrl + r
. type something. can fzf be integrated here ? -
what is
symoblic links
? how to make them? think of examples when they are useful ?
optional search for hard links
how they differ from symbolic links
after creating a link
run ls -l
what do you notice ?
6- what does diff
command do ? how it is useful ? what about patch