How to display the last 5 bytes?

077

To display the last 5 bytes of a file in a Unix-like operating system, you can use the tail command with the -c option. Here’s how to do it:

Command:

tail -c5 /tmp/hello

Breakdown:

  • tail: This command outputs the end of a file.
  • -c5: This option specifies that the last 5 bytes should be displayed.
  • /tmp/hello: This is the path to the file you want to read.

Example Output:

If the file hello contains:

Hello, World!

Running the command will output:

orld!

This command is useful for quickly checking the last few bytes of a file. If you have any further questions, feel free to ask!

0 Comments

no data
Be the first to share your comment!