Bash Tips and Pitfalls

From miki
Revision as of 09:40, 19 January 2009 by Mip (talk | contribs) (Bash Tips moved to Bash Tips and Pitfalls: We'll also add common pitfalls to this page)
Jump to navigation Jump to search

Empty a file named filename, keeping the same permission and user/group:

>filename

Print multi-lines text with echo:

$ echo -e "Some text\n...on 2 lines..."                    # Enable interpretation of backslash escapes (must be quoted!)
Some text
...on 2 lines...