2
0
Fork 0
mirror of https://github.com/Idnan/bash-guide.git synced 2018-11-09 02:29:39 +01:00

Add some text commands (#3)

* Add echo command

* Add sort command

* Add uniq command
This commit is contained in:
Jure Malovrh 2017-04-02 06:38:05 +02:00 committed by Adnan Ahmed
parent 3890c82334
commit ed3afd3ea2

View file

@ -312,10 +312,47 @@ Where `7459` is lines, `15915` is words and `398400` is characters.
TODO TODO
### e. `sort` ### e. `sort`
TODO Sort lines of text file(s)
```bash
sort filename
```
Example:
```bash
$ sort demo.txt
a
b
c
d
$ sort demo.txt -r
d
c
b
a
```
### f. `uniq` ### f. `uniq`
TODO Omit repeated lines of text file or standard input
```bash
uniq filename
```
Example:
```bash
$ cat demo.txt
a
a
b
c
c
a
a
a
$ uniq demo.txt
a
b
c
a
```
### g. `cat` ### g. `cat`
TODO TODO
@ -324,7 +361,17 @@ TODO
TODO TODO
### i. `echo` ### i. `echo`
TODO Display a line of text
```bash
echo
```
Example:
```bash
$ echo test
test
$ echo $HOME
/home/user
```
### j. `fmt` ### j. `fmt`
TODO TODO