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 ChrisInEdmonton for How to cut a file to a given size under Linux?

$
0
0

You may want to use the truncate command:

truncate --size=1G test.txt

SIZE can be specified as bytes, KB, K, MB, M, etc. I assume you can calculate the desired size by hand; if not, you could probably use the stat command to get information about the file's current size.


Viewing all articles
Browse latest Browse all 6