Unix Commands Quick Reference

Useful commands and flags that we get tired of looking up...

Disk Space

The du command is verbose and confusing if you run it without options. Here is how to get a human-readable output and a grand total for the path argument (omit for current directory).

du -hc

Fixing Line Endings

If you get odd errors after transferring a text file from a PC or Mac to a Unix machine, it's likely that you have a problem with newline characters. This is especially common when editing files in Excel and saving them to tab-delimited or comma-delimited files for input into. You can generally avoid this problem and fix the line endings by using an industrial strength text editor. This command converts Mac line endings in a saved Excel file to Unix line endings.

tr "\r" "\n" < input.tab >.converted.tab

Edit | Attach | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...

 Barrick Lab  >  WebLeftBar  >  ComputationList  >  ProtocolsUnixCommandsQuickReference

Topic revision: r2 - 30 May 2014 - 11:52:53 - Main.JeffreyBarrick
 
This site is powered by the TWiki collaboration platformCopyright ©2017 Barrick Lab contributing authors. Ideas, requests, problems? Send feedback