Bash Tips and Pitfalls

From miki
Revision as of 01:17, 19 November 2008 by Mip (talk | contribs)
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...