Difference between revisions of "BasicUnixUtilities"

(Tasks)
(Tasks)
Line 62: Line 62:
 
** counts words.  most often used as wc -l to count the number of lines
 
** counts words.  most often used as wc -l to count the number of lines
 
** wc -l < myfile
 
** wc -l < myfile
 +
 +
* ??? 
 +
** sort based not on # but on alphabet, sort all the A's, B's. C's etc.
  
 
==If you want to manipulate a text file:==
 
==If you want to manipulate a text file:==

Revision as of 22:46, 10 June 2007

Why are we doing this

  • To share how to do basic unix utilites.


How we know we are done

  • To sort a long list fo stuff

Definition

  • We are tring to get a list
  • how to use stuff to get information out of large lists of stuff that developers give less experiecenced developers or non developers.


People

  • Jason and Mark


Tasks

For example

  • Text file with one thing per line.
  • Opening a terminal window on your mac.
  • Look at the top of the file:
    • in the command line type head "filename" - this lets us know what the file looks like.


  • grep
    • grep will print output lines that match the first argument. If you have a file that looks like
my file
your file
    • grep my will show "my file"
  • ls
    • shows the list of files in a directory


  • cat
    • displays the contents of a file
  • |
    • ties commands together. (see uniq)
    • redirects the output to a file
    • ls > list_of_files.txt
  • sort
    • sorts things. with -n will use numerical sorting (instead of the default alphabetical)
    • sort


Retrieved from "http://aboutus.com/index.php?title=BasicUnixUtilities&oldid=7394178"