We are going to practice with bash
, a shell and command-line language!
-
Download the folder to your machine and navigate to it folder.
-
Run the following command (without the
$
sign):
$ ls
and you should see:
exercises inputs lorem lorem-copy modules outputs README.md
- Try to do the following exercises without changing the directory.
- Print in console "Hello World".
- Create a directory called
new_dir
. - Remove that directory.
- Copy the file
sed.txt
from thelorem
folder tolorem-copy
folder. - Copy the other two files from the
lorem folder
tolorem-copy
folder in just one line with the pipe;
. - Show the
sed.txt
file content from thelorem
folder. - Show the
at.txt
file andlorem.txt
file contents fromlorem
folder. - Print the first 3 rows in
sed.txt
file from lorem-copy folder. - Print the last 3 rows in
sed.txt
file from lorem-copy folder. - Add
Homo homini lupus.
at the end ofsed.txt
file fromlorem-copy
folder. - Print the last 3 rows in
sed.txt
file fromlorem-copy
folder. You should seeHomo homini lupus.
. - Replace all
et
repetitions byET
inat.txt
file from lorem folder to lorem-copy folder. Look thesed
command. - Find who is the system user.
- Find which is your actual path.
- List all files with the extension
.txt
in lorem folder. - Count the rows in
sed.txt
file from lorem folder. Look concatenatecat
andwc
with the pipe|
. - Count the files start with
lorem
in all directories. - Count how many times
et
appears inat.txt
fromlorem
folder. - Count how many times
et
appears inat.txt
fromlorem-copy
folder.
- Store your
name
in a variable withread
command. - Print that variable.
- Create a new directory named with variable
name
. - Remove that directory.
- For each file in
lorem
folder, print the number of characters of its name.