show text file in linux code example
Example 1: display contents of file ubuntu
less fileName
or
cat fileName
Example 2: find text in linux file
grep 'word' filename
grep 'word' file1 file2 file3
grep 'string1 string2' filename
cat otherfile | grep 'something'
command | grep 'something'
command option1 | grep 'data'
grep --color 'data' fileName
Example 3: view file linux command line
cat filename #for short files
less filename #for longer files