Quantcast
Channel: How to cut a file to a given size under Linux? - Super User
Viewing all articles
Browse latest Browse all 6

Answer by Ivan Malyshev for How to cut a file to a given size under Linux?

$
0
0

You can use tail to cut last 1000 bytes, example:

tail -c 1000 file > file2

the -c outputs final 1000 bytes of the file, for more options:

man tail

To replace original file with the file you just generated:

mv file2 file


Viewing all articles
Browse latest Browse all 6

Trending Articles