Which command uses -n option?

066

The -n option is commonly used with several commands in Linux. Here are a few examples:

  1. head: The -n option specifies the number of lines to display from the beginning of a file.

    head -n 5 filename.txt
  2. tail: Similar to head, the -n option specifies the number of lines to display from the end of a file.

    tail -n 5 filename.txt
  3. nl: The -n option can be used to control the numbering of lines.

    nl -n ln filename.txt
  4. xargs: The -n option limits the number of arguments passed to the command.

    echo "one two three" | xargs -n 1 echo

If you need more information about a specific command, feel free to ask!

0 Comments

no data
Be the first to share your comment!