Thursday, August 26, 2010

Linux/Unix : Working with files

Unix files
We have discussed unix files here.

File names


Displaying file contents -Overview

There are multiple ways to display file content. So, what is equivalent of notepad here?
  • cat - used to display the content
  • more - used to display the content, but paginate the content 
  • Moreover we can display part of files using head and tail.
  • We can search the files using grep.
  • Sort the files using sort
  • Compare the files using diff
  • cut the file part using cut
  • remove the duplicate lines using uniq.
  • Count the words, lines and characters using wc
  • Print the file using lpr, lpq and lprm.

Displaying the contents of file

    Displaying parts of files



    Searching files

    Sorting files


    Comparing files

    Comparing files using diff

    Cutting fields
    cut

    Pasting file contents
     
    Duplicate lines

    Non ascii files

    Printing files

    0 comments:

    Post a Comment