- Print the first 10 lines of input by default.
- Add a -n flag to specify the number of lines to print.
- Default 10 lines.
user@user-VirtualBox:~$ python3 head.py -n 4 fileName
- Print the last 10 lines of input by default.
- Add a -n flag to specify the number of lines to print.
- Default 10 lines.
user@user-VirtualBox:~$ python3 tail.py -n 4 fileName
- Count lines, words, and characters in the input.
- Add -l, -w, and -c flags to display only lines, words, or characters respectively.
- Default displays lines, words, and characters.
user@user-VirtualBox:~$ python3 wc.py -w -c fileName
- Concatenate and print files.
- Add a -n flag to number output lines.
user@user-VirtualBox:~$ python3 cat.py -n fileName1 fileName2 fileName3
- Print arguments to standard output.
- Add a -n flag to omit the trailing newline.
user@user-VirtualBox:~$ python3 echo.py -n hello world
- Print enviroment variables to standard output.
user@user-VirtualBox:~$ python3 env.py
- Print tree structure of a directroy to standard output.
- Add a -L flag to stop at a certain level.
user@user-VirtualBox:~$ python3 tree.py -L 5 DirectoryName
- Repeatedly output a message to standard output.
- Default message "y".
user@user-VirtualBox:~$ python3 yes.py hello world
- Returns a successful exit status code of 0.
user@user-VirtualBox:~$ python3 true.py
- Returns an unsuccessful exit status code of 1.
user@user-VirtualBox:~$ python3 false.py