Skip to content

Instantly share code, notes, and snippets.

@shang-lin
Last active December 19, 2015 22:09
Show Gist options
  • Save shang-lin/6025536 to your computer and use it in GitHub Desktop.
Save shang-lin/6025536 to your computer and use it in GitHub Desktop.
This is my own command line-fu: one-liners on the Bash CLI that I find useful.

Formatting strings

printf "%s %d %d %d\n" "Testing" 1 2 3

Output:

Testing 1 2 3

Remove whitespace

echo '1 2 3' | tr -d ' '

Output:

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