Reading Files From the Shell Print

  • 0

Looking at contents.

WHAT cat DOES

Prints a whole file.

WHEN TO USE IT

Short files only.

WHY NOT LONG ONES

The output scrolls past and cannot be read.

WHAT less DOES

Shows a file a screen at a time, scrollable.

HOW TO MOVE IN IT

Arrows and page keys A slash to search n for the next match q to quit

WHY IT IS THE RIGHT DEFAULT

It handles any size, and it does not load the whole file.

WHAT head DOES

Shows the first lines, ten by default.

WHAT tail DOES

Shows the last lines.

WHAT tail WITH THE FOLLOW OPTION DOES

Keeps showing new lines as they are written.

WHY THAT IS THE MOST USED COMMAND IN TROUBLESHOOTING

It shows a log live while you reproduce a problem.

WHAT wc DOES

Counts lines, words and characters.

WHAT TO USE IT FOR

Establishing how large something is before opening it.

WHAT file DOES

Reports what kind of file something is.

WHY THAT MATTERS

Extensions lie, and opening a binary in a text viewer floods the terminal.

WHAT TO DO IF THAT HAPPENS

Run reset.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot