Skip to content

Instantly share code, notes, and snippets.

@woodRock
Last active March 11, 2021 00:10
Show Gist options
  • Select an option

  • Save woodRock/000b1c785ab52488f5ef6d797861e563 to your computer and use it in GitHub Desktop.

Select an option

Save woodRock/000b1c785ab52488f5ef6d797861e563 to your computer and use it in GitHub Desktop.
Truncate: Remove the last two characters of a file in Linux.
#! /bin/bash
truncate -s-2 filename
@woodRock

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment