- Published on
The difference between `cat` and `less`
- Authors
- Name
- hwahyeon
cat
(Concatenate and Display Files):
The cat
command outputs the entire contents of a file at once. For example, if you type cat test.txt
, the full content of test.txt
will be displayed on the screen immediately. If the file is long, the screen will scroll quickly to show all the content.
less
:
The less
command displays the contents of a file one screen at a time. For example, if you type less test.txt
, the content of test.txt
will be shown one page at a time. You can then use the spacebar or arrow keys to navigate through the file page by page.