Using ‘wc’ and ‘sort’ commands to showing file details

A Linux Hosting India administrator use a number highly useful commands to execute the file handling processes. ‘wc’ command is also used to perform a number of specific file functions in Linux hosting. Find below the syntax of this command.

  • $ wc[options] filename: Gives the number of lines, words and characters in a file called filename
  • wc –l filename : Gives the number of lines
  • wc –w filename : Gives the number of words
  • wc –c filename : Gives the number of characters
  • Sort: It prints the lines of the file in sorted order.

Syntax: $ sort filename

Rate this post:


1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...