• Home
  • About
  • Map
  • Archives
  • Videos
  • Gallery
Grab the RSS feed

spiralbound.net

spiralbound.net
  • Home
  • Adventures
  • Data and Technology
  • Et cetera
  • Highlights

Posts Tagged with "foreach"

  • Data and Technology

    Posted on November 27th, 2006

    Written by cliff

    Tags

    commands, computing, directory, directory sizes, disk, foreach, HowTo, linux, quota, repquota, server, size, sort, storage, unix, users

    Using Sort to List Directories by Size

    Using Sort to List Directories by Size

    If you manage a UNIX system with a large number of directories that vary in size, chances are that you’ve needed to figure out which ones are using up the most disk space. Of course if the directories are user accounts, the best way to do this is to enable quotas and use the “repquota” [...]

  • Data and Technology

    Posted on January 17th, 2006

    Written by cliff

    Tags

    foreach, grep, ls, shell, syntax, tcsh

    Foreach Example in tcsh

    I always forget the foreach syntax. Here is a quick example that reads all the contents of a directory into an array, prints out the name of each file, runs a simple grep on it, and ends.
    foreach i ( ` /bin/ls * ` )
    foreach? echo $i
    foreach?/bin/grep your_grep_string $i
    foreach? end

  • Sponsor
  • Recent Comments
    • conor on Fish Supposedly Washed Up By Asian Tsunami
    • cliff on Raising Mallard Ducklings
    • Jan on Raising Mallard Ducklings
    • jeremy on Raising Mallard Ducklings
    • odane on Fish Supposedly Washed Up By Asian Tsunami
    • Bill on Raising Mallard Ducklings Redux
    • B Woehl on Why Did my Arm Fall Asleep?

Copyright © 2006 spiralbound.net - Proudly powered by Wordpress