From b2159662f368c6389ec3e40af7c780b9c7b3d8f4 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Fri, 23 Aug 2013 18:42:26 -0400 Subject: [PATCH] Committed a cheatsheet for 'truncate' --- cheatsheets/truncate | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 cheatsheets/truncate diff --git a/cheatsheets/truncate b/cheatsheets/truncate new file mode 100644 index 0000000..f871c76 --- /dev/null +++ b/cheatsheets/truncate @@ -0,0 +1,10 @@ +To clear the contents from a file: +truncate -s 0 file.txt + +To truncate a file to 100 bytes: +truncate -s 100 file.txt + +To truncate a file to 100 KB: +truncate -s 100K file.txt + +(M, G, T, P, E, Z, and Y may be used in place of "K" as required.)