

Managing Work-In-Progress Folders with “ls -ltr” - sefk
http://sef.kloninger.com/2012/08/wip-folders-with-ls/

======
phireal
Combine watch with ls -ltr and you have a neat little way to keep an eye on a
given file or directory:

    
    
        watch -n 1 ls -ltr

------
rwmj
Like the author, I probably use 'ls -ltr' more often than any other variation
of ls. It's more useful to view most directories in date order (newest nearest
to your cursor), although of course this probably _won't_ be news to most GUI
/ Windows users.

Edit: A small shell script over my history proves my guess is correct:

    
    
        plain ls: 59
        ls -ltr: 8
        ll: 6

------
robertskmiles
I do basically the same thing. In fact I have 'ls -cr' automatically run after
every cd.

The problem with aliases of course is that you end up typing them on other
people's systems and looking foolish. Still, I use 'lcr' for 'ls -cr', 'll'
for 'ls -alF', etc.

~~~
stinos
I even have 'l' as 'ls -halF'. And it's used so much that the L button on my
keyboard seems to grow more fungi than the others.

------
BoppreH
Funny, I've come to use the same system some time ago, but for general to-dos.
I just use more readable filenames, with spaces instead of dashes and more
complete sentences, and in the file content I put more detailed info and links
do resources.

The great thing about this is that it's utterly portable. You can sync with
Dropbox, explore with a file manager, zip and send by email, grep, open and
edit with scripts... The possibilities are endless, and you don't have to
install anything.

------
kragen
I always use ls -lart. It's handy for a lot of different things. What's the
name of that file I just downloaded? Which subdirectory of my home directory
is the one where that program saves its config information? What have I been
working on in the last month?

------
pif
Why not recursive? Use the following command if you want to have one directory
per idea, rather than a single file:

    
    
      find -type f -print0 | xargs --null ls -ltr

~~~
q_revert
I know it gets talked about quite a lot round here but I find zsh really quite
useful for this type of thing..

the zsh equivalent of the above, for me would be

    
    
        ls **/* -ltr 
    

(Edit)[ for an exact reproduction ]

    
    
        ls **/*(.) -ltr
    

if you wanted to put a date range on it.. for example, only files from the
last 5 days..

    
    
        ls **/*(m-5) -ltr
    

or the last 5 hours

    
    
        ls **/*(mh-5) -ltr
    
    

there's loads more of these <http://grml.org/zsh/zsh-lovers.html>, obviously
your shell is a matter of preference, and if you know bash or something
similar well enough then the incentive to change is obviously lessened.. but
_personally_ I've found that a whole series of small improvements (for me)
added up to a pretty large win

edit: as pointed out by pyre, my initial suggestion isn't an exact replica..
but was the first thing that came to mind for me.. i guess s/the\ zsh\
equivalent/something\ similar\ in\ zsh/

edit again:

    
    
        /tmp/ $ mkdir -p /tmp/test1/test2/test3                          
        /tmp/ $ touch /tmp/test1/test2/test3/test4                       
        /tmp/ $ ls -ltr /tmp/test1/**/*(.)                               
        -rw-r--r-- 1 usr grp 0 Aug  7 15:49 /tmp/test1/test2/test3/test4 
        /tmp/ $ find /tmp/test1 -type f -print0 | xargs -0 ls -ltr       
        -rw-r--r-- 1 usr grp 0 Aug  7 15:49 /tmp/test1/test2/test3/test4

~~~
pif
Nice to know, thanks! But, how does it work with file names containing spaces
(or other strange characters)?

Edit: just to clarify: my question concerns the zsh method. Regarding
find+xargs, I wrote that comment :-) Actually, this edit would be an answer to
zap; HN does not let me reply directly to him: is it to prevent flame-wars?

~~~
q_revert

       /tmp/ $ mkdir -p test1/test2/test3                                       
    
       /tmp/ $ touch test1/test2/test3/test4                                    
       
       /tmp/ $ ls -ltr test1/**/*(.)                                            
       -rw-r--r-- 1 usr grp 0 Aug  9 11:11 test1/test2/test3/test4              
    
       /tmp/ $ touch test1/test2/test3/test\ with\ spaces                       
    
       /tmp/ $ ls -ltr test1/**/*(.)                                            
       -rw-r--r-- 1 usr grp 0 Aug  9 11:11 test1/test2/test3/test4              
       -rw-r--r-- 1 usr grp 0 Aug  9 11:12 test1/test2/test3/test with spaces

------
nickknw
Interesting timing on this; I just starting using _almost_ this exact command
(`ls -1tr`) days ago. Great for checking the last few things in that giant
`Downloads/` folder

~~~
webreac
ls -lrt is probably the command I use the most in Unix since ... 20 years.

------
figital
Hey can someone write me a script that will draw a bar chart of the frequency
by date/month/year of each file's last modification time (in a directory)?
Free beer. I promise!

------
Adrock
I use it frequently enough that I've aliased "lt" to it. Any other flags
people use with it?

------
tyler_ball
This is _exactly_ what version control is for.

~~~
pyre
Listing files in order of modification time?

~~~
tyler_ball
Not literally. I should clarify.

Using ls -ltr will indeed list files in order of modification time, but when I
read 'Managing Work-In-Progress Folders' I think version control.

ls will list your files, but it won't really 'manage' anything.

