od command in Linux

The od term stands for the octal dump. The od command displays the content of a file in hexadecimal, octal, and ASCII formats.

Syntax :

//display files in octal format  
od -b <fileName>      
//display files in hexadecimal bytes format  
od -t x1 <fileName>       
//display files in ASCII format and the new line is marked as \n
od -c <fileName>     

Output :

od-command-linux

fmt command in Linux

The fmtcommand is a simple and optimal text formatter. It is helpful to reformat the input data and print in end result in the standard output format.

Syntax :

fmt <option> <file name>

Options :

  • w, – -width=WIDTH option
    fmt-linux
  • -t, – -tagged-paragraph option There can be a need for highlighting the very first line in a text file which can be done by making the indentation of the first-line different from the other lines which can be done with the -t command.
    fmt-t-command-linux
  • -s option: This option split long lines, but don’t refill them.
    fmt-s-linux
  • -u, – -uniform-spacing option: This option uses one space between words and two spaces after sentences for formatting
    fmt-u-input-linux
    fmt-u-output-linux
  • -c, – -crown-margin option : This option preserves the indentation of the first two lines.
    fmt-c-linux
  • -p, – -prefix=STRING option : This option takes a STRING as an argument and reformats only lines beginning with the given STRING, reattaching the prefix to reformatted lines.
    In the below output, we can notice that the lines are reformatted wherever the word "Cypress" is present.
    fmt-p-linux
  • -g, – -goal=WIDTH option : This option refers to the goal width i.e default of 93% of width.
    fmt-g-command
  • – -help option : This displays the available options for the fmt command.
  • – -version option : This display version information about the fmt command.

more command in Linux

The morecommand displays the data of the larger file in page format. The page down and page up key will not work. To display the new record, we need to press the “enter” key.

Syntax :

cat <file path> | more

Example :

cat file1 | more

Output :
more-output-command-linux

less command in Linux

The less command is like more command but it is faster with large files. It will display the content of the large file in a page format.The page down and page up key will work. To display the new record, we need to press the “enter” key.

Syntax:

cat <file path> | less

Example :

cat file1 | less

less-output

Output :
less-command-linux

find command in Linux

The find filter command is useful to find the files from the Linux operating system.

Syntax:

find <path> -name <file name>

Example :

find / -name "f1"

In the above command we are finding the file named "f1" and the path to find the directory as root directory ("/").

Output :
find-command-linux

pr command in Linux

The pr command is useful to convert the input data into the printable format with proper column structure.

Example:

dbkg -l | pr --columns 3 -l 20

In the above pr command, we are printing the output data in three columns and with 20 lines on an individual page.

Output :
pr-linux

0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions