*** Daniel's Linux Command Notes *** # ###### for fred in ~edwards/sl/io/*.c; do echo "*** $fred ***" >> t.c; cat $fred >> t.c; done #Takes all the *.c files and appends their contents to t.c. This will put the #name of each file in t.c before it's appended. commands to research comm (Is there a better way to tell columns apart?) cut, paste # Format # [command call description ' cannot do. [comm ## ASCII file manipulation ## [vi '-b' enables binary mode. '-r' is swp info. [col [colrm Removes characters after the first of each line, with the first starting at 1. "colrm 2 2" removes the second character from each line of standard input. [column '-t' is useful. [cut See http://www.thegeekstuff.com/2013/06/cut-command-examples/ [od Prints a file in a special format. (i.e. octal, hex, binary, etc.) ## File merging ## [join Joins the file columns together. See http://www.thegeekstuff.com/2012/10/15-linux-split-and-join-command-examples-to-manage-large-files/ [paste Appends lines of the same number together. ## File splitting ## [split [csplit Splits a file by patterns rather than bytes or lines. ## Directory information ## [df Quicker than "du". Run with '-h'. [du Folder by folder. Run with '-hcs' and maybe '-x'. [ls ## Directory manipulation ## [mkdir '-p' will create parent directories if they don't exist. [rmdir '-p' will remove as much as possible in the given source path. [pwd (bash built-in), /bin/pwd (*) [umask ## Misc ASCII manipulation ## [diff [expand Will put the right number of spaces so that the columns are aligned. [fmt Simple formatting for paragraphs. [par Advanced formatting program. [fold Wordwraper. [head Start of the input. [tail End of the input. '-F' is very helpful for files which will keep expanding, usch as a log. ## Compression ##