- I familiarized myself with the commands
head
,tail
,find
,wc
,sort
,uniq
,grep
, andtr
. - I learned how to redirect standard output to a file.
- How to get standard input from a file instead of the keyboard.
- How to send the standard output from one peogram to the input of another program.
- How to combine commands and filters with redirections.
- I learned about special characters.
- I familiarized myself with white spaces, single quotes, doubles quotes, backslash, comments, pipe, command separator, tilde and how and when to use them
- I learned how to display a line of text.
- How to concantenate files and print on the standard output.
- How to reverse a string
- How to remove sections from each line of files.
- What is the
/etc/passwd
file and what is its format. - What is the
/etc/shadow
file and what is its format.
-
0. Hello World
- 0-hello_world: Bash script that prints “Hello, World”, followed by a new line to the standard output.
-
1. Confused smiley
- 1-confused_smiley: Bash script that displays a confused smiley
"(Ôo)'
.
- 1-confused_smiley: Bash script that displays a confused smiley
-
2. Let's display a file
- 2-hellofile: Bash script that displays the content of the
/etc/passwd
file.
- 2-hellofile: Bash script that displays the content of the
-
3. What about 2?
- 3-twofiles: Bash script that displays the content of
/etc/passwd
and/etc/hosts
.
- 3-twofiles: Bash script that displays the content of
-
4. Last lines of a file
- 4-lastlines: Bash script that displays the last 10 lines of
/etc/passwd
.
- 4-lastlines: Bash script that displays the last 10 lines of
-
5. I'd prefer the first ones actually
- 5-firstlines: Bash script that displays the first 10 lines of
/etc/passwd
.
- 5-firstlines: Bash script that displays the first 10 lines of
-
6. Line #2
- 6-third_line: Bash script that displays the third line of the file
iacta
.
- 6-third_line: Bash script that displays the third line of the file
-
7. It is a good file that cuts iron without making a noise
- 7-file: Bash script that creates a file named exactly
\*\\'"Best School"\'\\*$\?\*\*\*\*\*:)
containing the textBest School
ending by a new line.
- 7-file: Bash script that creates a file named exactly
-
8. Save current state of directory
- 8-cwd_state: Bash script that writes into the file
ls_cwd_content
the result of the commandls -la
. If the filels_cwd_content
already exists, it should be overwritten. If the filels_cwd_content
does not exist, create it.
- 8-cwd_state: Bash script that writes into the file
-
9. Duplicate last line
- 9-duplicate_last_line: Bash script that duplicates the last line of the file
iacta
- The file
iacta
will be in the working directory
- The file
- 9-duplicate_last_line: Bash script that duplicates the last line of the file
-
10. No more javascript
- 10-no_more_js: Bash script that deletes all the regular files (not the directories) with a
.js
extension that are present in the current directory and all its subfolders.
- 10-no_more_js: Bash script that deletes all the regular files (not the directories) with a
-
11. Don't just count your directories, make your directories count
- 11-directories: Bash script that counts the number of directories and sub-directories in the current working directory.
- The current and parent directories should not be taken into account
- Hidden directories should be counted
- 11-directories: Bash script that counts the number of directories and sub-directories in the current working directory.
-
12. What’s new
- 12-newest_files: Bash script that displays the 10 newest files in the current directory.
- One file per line
- Sorted from newest to the oldest.
- 12-newest_files: Bash script that displays the 10 newest files in the current directory.
-
13. Being unique is better than being perfect
- 13-unique: Bash script that takes a list of words as input and prints only words that appear exactly once.
- Input format: One line, one word
- Output format: One line, one word
- Words should be sorted
- 13-unique: Bash script that takes a list of words as input and prints only words that appear exactly once.
-
14. It must be in that file
- 14-findthatword: Bash script that displays lines containing the pattern "root" from the file
/etc/passwd
.
- 14-findthatword: Bash script that displays lines containing the pattern "root" from the file
-
15. Count that word
- 15-countthatword: Bash script that displays the number of lines that contain the pattern "bin" in the file
/etc/passwd
.
- 15-countthatword: Bash script that displays the number of lines that contain the pattern "bin" in the file
-
16. What's next?
- 16-whatsnext: Bash script that displays lines containing the pattern "root" and 3 lines after them in the file
/etc/paswd
.
- 16-whatsnext: Bash script that displays lines containing the pattern "root" and 3 lines after them in the file
-
17. I hate bins
- 17-hidethisword: Bash script that displays all the lines in the file
/etc/passwd
that do not contain the pattern “bin”.
- 17-hidethisword: Bash script that displays all the lines in the file
-
18. Letters only please
- 18-letteronly: Bash script that displays all lines of the file
/etc/ssh/sshd_config
starting with a letter.- Include capital letters as well
- 18-letteronly: Bash script that displays all lines of the file
-
19. A to Z
- 19-AZ: Bash script that replaces all characters
A
andC
from input toz
ande
respectively.
- 19-AZ: Bash script that replaces all characters
-
20. Without C, you would live in hiago
- 20-hiago: Bash script that removes all letters
c
andC
from input.
- 20-hiago: Bash script that removes all letters
-
21. esreveR
- 21-reverse: Bash script that reverses its input.
-
22. DJ Cut Killer
- 22-users_and_homes: Bash script that displays all users and their home directories, sorted bu users.
- Based on the
/etc/passwd
file
- Based on the
- 22-users_and_homes: Bash script that displays all users and their home directories, sorted bu users.
-
23. Empty casks make the most noise
- 100-empty_casks: Bash script that finds all empty files and directories in the current directory and all sub-directories.
- Only the names of the files and directories should be displayed (not the entire path)
- Hidden files should be listed
- One file name per line
- The listing should end with a new line
- You are not allowed to use
basename
,grep
,egrep
,fgrep
orrgrep
- 100-empty_casks: Bash script that finds all empty files and directories in the current directory and all sub-directories.
-
24. A gif is worth ten thousand words
- 101-gifs: Bash script that lists all the files with a
.gif
extension in the current directory and all its sub-directories.- Hidden files should be listed
- Only regular files (not directories) should be listed
- The names of the files should be displayed without their extensions
- The files should be sorted by byte values, but case-insensitive (file
aaa
should be listed before filebbb
, file.b
should be listed before filea
, and fileRona
should be listed after filejay
) - One file name per line
- The listing should end with a new line
- You are not allowed to use
basename
,grep
,egrep
,fgrep
orrgrep
- 101-gifs: Bash script that lists all the files with a
-
25. Acrostic
- 102-acrostic: Bash script that decodes acrostics that use the first letter of each line.
- The ‘decoded’ message has to end with a new line
- You are not allowed to use
grep
,egrep
,fgrep
orrgrep
- 102-acrostic: Bash script that decodes acrostics that use the first letter of each line.
-
26. The biggest fan
- 103-the_biggest_fan: Bash script that parses web servers logs in TSV format as input and displays the 11 hosts or IP addresses which did the most requests.
- Order by number of requests, most active host or IP at the top
- You are not allowed to use
grep
,egrep
,fgrep
orrgrep
- 103-the_biggest_fan: Bash script that parses web servers logs in TSV format as input and displays the 11 hosts or IP addresses which did the most requests.