mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
2 years ago
|
## Master the ls
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Put in a file `master-the-ls`, the command line that will:
|
||
|
|
||
|
- list the files and directories of the current directory.
|
||
|
- Ignore the hidden files, the "." and the "..".
|
||
|
- Separates the results with commas.
|
||
|
- Order them by ascending order of access time (the newest first).
|
||
|
- Have the directories ends with a `/`.
|
||
|
|
||
2 years ago
|
### Hints
|
||
2 years ago
|
|
||
|
Here are some Commands that can help you:
|
||
|
|
||
2 years ago
|
- `tr`. Translate characters: run replacements based on single characters and character sets.
|
||
2 years ago
|
|
||
|
- Replace all occurrences of a character in a file, and print the result:
|
||
|
`tr {{find_character}} {{replace_character}} < {{filename}}`
|
||
|
|
||
2 years ago
|
- `ls`. List directory contents.
|
||
|
- `sed`. Edit text in a scriptable manner.
|
||
|
|
||
|
> You have to use Man or Google to know more about commands flags, in order to solve this exercise!
|
||
|
> Google and Man will be your friends!
|
||
|
|
||
|
### References
|
||
|
|
||
|
- [tr](https://www.gnu.org/software/coreutils/tr).
|
||
|
- [ls](https://www.gnu.org/software/coreutils/ls).
|
||
|
- [sed](https://www.gnu.org/software/sed/manual/sed.html).
|