->Title Page
->Intro
->Unix
-->Overview
-->File Structure
-->Online Manual
-->Basic Commands
-->Additional Commands
-->Login files
-->Special characters
-->Miscellaneous Tips
--->Strange names
--->Advanced wildcards
--->Terminal input
--->Remote shell
--->Loops in scripts
->More tips
-->Things to try
->Vi editor
->Mirror sites
->Further reading

[ Up ]
[Prev][Home][Next]
[Author]

Unix ---> More tricks

Every word of a file can be placed on a separate line by typing


    cat old_filename | tr -cs A-Za-z '\012' > new_filename
The following lists all words in filename in alphabetical order.


    cat filename | tr -cs A-Za-z '\012' | tr A-Z a-z | sort | uniq
You can find out when the file .rhosts was last modified by typing


    echo .rhosts last modified on `/bin/ls -l .rhosts | cut -c33-44`
Typing head -n displays the first n lines of a file. And typing last lists the last logins.


    grep '^...............$' /usr/share/dict/words  | grep -v '\(.\).*\1'
returns all the words in /usr/share/dict/words that are fifteen letters long and do not contain the same letter twice.


    grep 'a[^aeiou]*e[^aeiou]*i[^aeiou]*o[^aeiou]*u' /usr/share/dict/words
returns all the words in /usr/share/dict/words that contain all of the vowels in the correct order.

Site Statistics

t a y l o r@l i n u x b o x.c o m

© 1993-1998 Christopher C. Taylor