euglug.org

[카테고리:] Uncategorized

  • [Eug-lug] help with directory listing



    Ben BarrettTue Mar 4 18:34:21 PST 2008

    I'd also like to point out the "-1" option for "ls", my most common usage is:
    ls -ltr
    to show most recent files at the bottom of the listing (oldest first),
    long-style listing...
    but if I do need to do something with just the filename(s), I'd use
    something like this instead:
    ls -1tr|tail -n 1
    
    As for nifty usages, you can also have fun with back-ticks, like this:
    for i in `ls -1`; do echo filename is  $i; done
    
    but of course substituting various options in on ls, can include a
    grep inside the backticks, and of course do more useful things than
    echo....
    
    ciao,
    
    Ben
    
    
    
    
    On Tue, Mar 4, 2008 at 5:50 PM, Fred James <fredjame at fredjame.cnc.net> wrote:
    > Rob Hudson wrote:
    >
    >  >Of course... how could I forget head and tail?!
    >  >
    >  >Thanks.
    >  >
    >  >On 3/4/08, Hal Pomeranz <hal at deer-run.com> wrote:
    >  >
    >  >
    >  >>ls -t | head -1
    >  >>
    >  >>
    >  Rob Hudson
    >  Will that do it for you, or do you need something to exclude/include any
    >  particular type(s) of file(s)?
    >  Regards
    >  Fred James
    >
    >
    >
    >  _______________________________________________
    >  EUGLUG mailing list
    >  euglug at euglug.org
    >  http://www.euglug.org/mailman/listinfo/euglug
    >
    
  • [Eug-lug] help with directory listing



    Rob HudsonTue Mar 4 18:02:46 PST 2008

    I haven't scripted it yet, but that should do it.
    
    I have a Python script that I've been manually pushing little backups
    up to Amazon's S3.  Things like bzipped database dumps or SVN dumps.
    I always want the latest and want to just shove it off the server as a
    cheap and easy offsite backup.  So I'll use that to get the latest
    file inside my Python script.
    
    Thanks,
    Rob
    
    On Tue, Mar 4, 2008 at 5:50 PM, Fred James <fredjame at fredjame.cnc.net> wrote:
    >
    > Rob Hudson wrote:
    >
    >  >Of course... how could I forget head and tail?!
    >  >
    >  >Thanks.
    >  >
    >  >On 3/4/08, Hal Pomeranz <hal at deer-run.com> wrote:
    >  >
    >  >
    >  >>ls -t | head -1
    >  >>
    >  >>
    >  Rob Hudson
    >  Will that do it for you, or do you need something to exclude/include any
    >  particular type(s) of file(s)?
    >  Regards
    >  Fred James
    >
    
  • [Eug-lug] help with directory listing



    Fred JamesTue Mar 4 17:50:13 PST 2008

    Rob Hudson wrote:
    
    >Of course... how could I forget head and tail?!
    >
    >Thanks.
    >
    >On 3/4/08, Hal Pomeranz <hal at deer-run.com> wrote:
    >  
    >
    >>ls -t | head -1
    >>    
    >>
    Rob Hudson
    Will that do it for you, or do you need something to exclude/include any 
    particular type(s) of file(s)?
    Regards
    Fred James
    
    
  • [Eug-lug] help with directory listing



    Rob HudsonTue Mar 4 16:06:04 PST 2008

    Of course... how could I forget head and tail?!
    
    Thanks.
    
    On 3/4/08, Hal Pomeranz <hal at deer-run.com> wrote:
    > ls -t | head -1
    >
    
  • [Eug-lug] help with directory listing



    AlanTue Mar 4 15:53:28 PST 2008

    On Tue, March 4, 2008 3:50 pm, Alan wrote:
    > On Tue, March 4, 2008 3:46 pm, Rob Hudson wrote:
    >> I'll admit up front... I don't know my unix utility commands like I
    >> should.  Thinks like sed, awk, cut, sort, uniq, etc can all make for
    >> some powerful combinations.
    >>
    >> My goal via a shell script: Get the filename of the most recently
    >> modified
    >> file.
    >>
    >> I can do this:
    >>> ls -t
    >>
    >>
    >
    > Assuming GNU:
    >
    > ls -l | tail -1
    > ought to do it.
    >
    > -ajb
    >
    
    bah, stupid send button, why are you always in the wrong place?
    That should be:
    ls -tr | tail -1
    
    -ajb
    
    
    
  • [Eug-lug] help with directory listing



    Jimmy HendrixTue Mar 4 15:53:15 PST 2008

    Piping to:
    
    head -n 1
    or
    tail -n 1
    
    will get you the first and last line respectively.  Might be a better
    way, but that should work.
    
    Jimmy
    
    On Tue, Mar 4, 2008 at 3:46 PM, Rob Hudson <rob at cogit8.org> wrote:
    > I'll admit up front... I don't know my unix utility commands like I
    >  should.  Thinks like sed, awk, cut, sort, uniq, etc can all make for
    >  some powerful combinations.
    >
    >  My goal via a shell script: Get the filename of the most recently modified file.
    >
    >  I can do this:
    >  > ls -t
    >
    >  to get the files sorted by modified time.  But can you do a "LIMIT 1"
    >  a la SQL, or just get the first line?  Or reverse sort it to get the
    >  last line?
    >
    >  Thanks,
    >  Rob
    >  _______________________________________________
    >  EUGLUG mailing list
    >  euglug at euglug.org
    >  http://www.euglug.org/mailman/listinfo/euglug
    >
    
  • [Eug-lug] help with directory listing



    Hal PomeranzTue Mar 4 15:52:44 PST 2008

    ls -t | head -1
    
    -- 
    Hal Pomeranz, Founder/CEO      Deer Run Associates      hal at deer-run.com
        Network Connectivity and Security, Systems Management, Training
    
  • [Eug-lug] help with directory listing



    AlanTue Mar 4 15:50:08 PST 2008

    On Tue, March 4, 2008 3:46 pm, Rob Hudson wrote:
    > I'll admit up front... I don't know my unix utility commands like I
    > should.  Thinks like sed, awk, cut, sort, uniq, etc can all make for
    > some powerful combinations.
    >
    > My goal via a shell script: Get the filename of the most recently modified
    > file.
    >
    > I can do this:
    >> ls -t
    >
    >
    
    Assuming GNU:
    
    ls -l | tail -1
    ought to do it.
    
    -ajb
    
    
  • [Eug-lug] help with directory listing



    Rob HudsonTue Mar 4 15:46:16 PST 2008

    I'll admit up front... I don't know my unix utility commands like I
    should.  Thinks like sed, awk, cut, sort, uniq, etc can all make for
    some powerful combinations.
    
    My goal via a shell script: Get the filename of the most recently modified file.
    
    I can do this:
    > ls -t
    
    to get the files sorted by modified time.  But can you do a "LIMIT 1"
    a la SQL, or just get the first line?  Or reverse sort it to get the
    last line?
    
    Thanks,
    Rob
    
  • [Eug-lug] beaverbarcamp trip report



    Ben BarrettTue Mar 4 10:10:43 PST 2008

    I also heard, there, that SAO's Eugene Chapter is NOT dead, contrary
    to what I've been hearing lately :)
    It was suggested that maybe our local SAO could pitch in to help,
    organizing and/or fund[rais]ing, for a local Ingite as well as a
    potential local Bar Camp or some such...
    
    I like it.  I volunteer a lot already and am tapped at the moment.
    Ignite or Camp organizers, please feel free to check in with me
    monthly or so, as my availability will fluctuate.
    
    Also, I should mentioned that I did get roped into a coordination task
    -- helping with RecentChangesCamp, which will be held down in the
    SFbay area this year, May 17-19.
    
    cheerio & pre-coffee snarls to y'all,
    
    Ben
    
    
    On Tue, Mar 4, 2008 at 9:39 AM, Marsee Henon <marsee at oreilly.com> wrote:
    > Hi
    >
    >  Here's the main Ignite site from O'Reilly http://ignite.oreilly.com/.
    >  Make sure you submit yours here when you get it together.
    >  And let me know if you want me to help promote it and send some
    >  O'Reilly swag.
    >
    >  Marsee
    >
    >
    >
    >  On Mar 4, 2008, at 8:51 AM, kevin at k2dd.com wrote:
    >
    >  >> Ignite Eugene?
    >  >
    >  >
    >  > I think so!
    >  >
    >  > Several of us went to the Ignite session during the day and picked
    >  > Dawn's brain about how they organized the Portland Ignite.
    >  >
    >  > Who's interested in helping out? I'm definitely interested. We'll
    >  > need to get space, sponsors, food, PR, presenters, etc. It'll be a
    >  > bit of work.
    >  >
    >  > Let's get a group of us together and start planning!
    >  >
    >  > -kk
    >  >
    >  >
    >  > On Mar 4, 2008, at 8:33 AM, Rob Hudson wrote:
    >  >
    >  >> On 3/3/08, larry price <laprice at gmail.com> wrote:
    >  >>> * Being exposed to the Ignite format http://ignite.oreilly.com/
    >  >>>   (you get 5 minutes and 20 slides @1 per 15 seconds; what would you
    >  >>> talk about?)
    >  >>>   which was fun, and focused, I think an ignite style event would be
    >  >>> real fun and fairly straightforward to organize.
    >  >>
    >  >> Ignite Eugene?
    >  >> _______________________________________________
    >  >> EUGLUG mailing list
    >  >> euglug at euglug.org
    >  >> http://www.euglug.org/mailman/listinfo/euglug
    >  >
    >  > _______________________________________________
    >  > EUGLUG mailing list
    >  > euglug at euglug.org
    >  > http://www.euglug.org/mailman/listinfo/euglug
    >
    >  Marsee Henon
    >  O'Reilly Media, Inc.
    >  1005 Gravenstein Hwy North
    >  Sebastopol, CA  95472
    >
    >  marsee at oreilly.com
    >  707-827-7103
    >  http://ug.oreilly.com/
    >
    >
    >
    >
    >
    >
    >  _______________________________________________
    >  EUGLUG mailing list
    >  euglug at euglug.org
    >  http://www.euglug.org/mailman/listinfo/euglug
    >