Linux commands for sorting and searching information
sort tsort and grep commands with options
kodingwindow@kw:~$ ls
a.out  kw.cpp   kw.py    Documents  Music     Public     Videos
kw.c   KW.java  Desktop  Downloads  Pictures  Templates

kodingwindow@kw:~$ touch Weekdays
kodingwindow@kw:~$ ls
a.out  kw.cpp   kw.py    Documents  Music     Public     Videos
kw.c   KW.java  Desktop  Downloads  Pictures  Templates  Weekdays

kodingwindow@kw:~$ cat Weekdays
Weekdays
Monday
Tuesday
Wednesday
Thursday
Friday
Monday
Tuesday
Wednesday
Thursday
Friday

kodingwindow@kw:~$ sort Weekdays
Friday
Friday
Monday
Monday
Thursday
Thursday
Tuesday
Tuesday
Wednesday
Wednesday
Weekdays

kodingwindow@kw:~$ sort Weekdays | uniq
Friday
Monday
Thursday
Tuesday
Wednesday
Weekdays

kodingwindow@kw:~$ tsort Weekdays tsort: Weekdays: input contains an odd number of tokens kodingwindow@kw:~$ cat Weekdays Weekdays Monday Tuesday Wednesday Thursday Friday Monday Tuesday Wednesday Thursday kodingwindow@kw:~$ tsort Weekdays Weekdays Monday Tuesday Wednesday Thursday Friday kodingwindow@kw:~$ tac Weekdays Thursday Wednesday Tuesday Monday Friday Thursday Wednesday Tuesday Monday Weekdays
kodingwindow@kw:~$ cat Weekdays | grep day Weekdays Monday Tuesday Wednesday Thursday Friday Monday Tuesday Wednesday Thursday kodingwindow@kw:~$ grep day Weekdays Weekdays Monday Tuesday Wednesday Thursday Friday Monday Tuesday Wednesday Thursday kodingwindow@kw:~$ grep -v days Weekdays Monday Tuesday Wednesday Thursday Friday Monday Tuesday Wednesday Thursday kodingwindow@kw:~$ grep -i days Weekdays Weekdays kodingwindow@kw:~$
Advertisement