
{"id":5268,"date":"2011-06-20T21:10:43","date_gmt":"2011-06-20T21:10:43","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=5268"},"modified":"2011-06-20T21:10:43","modified_gmt":"2011-06-20T21:10:43","slug":"truncate-shrink-or-extend-the-size-of-a-file-to-the-specified-size","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2011\/06\/20\/truncate-shrink-or-extend-the-size-of-a-file-to-the-specified-size\/","title":{"rendered":"truncate &#8211; shrink or extend the size of a file to the specified size"},"content":{"rendered":"<h4><u> A UNIX Command <\/u><\/h4>\n<pre>\n$cat example.text\nhello\n$ls -l example.text\n-rw-r--r-- 1 jeffrin jeffrin 6 Jun 21 02:32 example.text\n$truncate -s 10 example.text\n$ls -l example.text\n-rw-r--r-- 1 jeffrin jeffrin 10 Jun 21 02:35 example.text\n$hexdump example.text\n0000000 6568 6c6c 0a6f 0000 0000\n000000a\n$cat example.text\nhello\n$truncate -s 9 example.text\n$ls -l example.text\n-rw-r--r-- 1 jeffrin jeffrin 9 Jun 21 02:36 example.text\n$hexdump example.text\n0000000 6568 6c6c 0a6f 0000 0000\n0000009\n$\n\n<\/pre>\n<p><\/p>\n<h4><u> UNIX Explanation <\/u><\/h4>\n<pre>\n`truncate' shrinks  or extends the  size of each  FILE to\nthe specified size.If a FILE is larger than the specified\nsize, the extra  data is lost.  If a  FILE is shorter, it\nis extended and the extended part (or hole) reads as zero\nbytes.\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A UNIX Command $cat example.text hello $ls -l example.text -rw-r&#8211;r&#8211; 1 jeffrin jeffrin 6 Jun 21 02:32 example.text $truncate -s 10 example.text $ls -l example.text -rw-r&#8211;r&#8211; 1 jeffrin jeffrin 10 Jun 21 02:35 example.text $hexdump example.text 0000000 6568 6c6c 0a6f 0000 0000 000000a $cat example.text hello $truncate -s 9 example.text $ls -l example.text -rw-r&#8211;r&#8211; 1 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2011\/06\/20\/truncate-shrink-or-extend-the-size-of-a-file-to-the-specified-size\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;truncate &#8211; shrink or extend the size of a file to the specified size&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[556,590,832,1603,1623],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/5268"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=5268"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/5268\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=5268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=5268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=5268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}