5
1
ls
, gives me all directories
ls -trh
, gives me all directories sorted by date (newest last)
ls -dtrh */ | tail -1
, gives me name of latest directory (by date)
Is it possible to somehow incorporate the ls
and cd
commands, so I could navigate to the latest directory. Something logically equal to ls -trh | tail -1 | cd
, but working.
It also gives you files. You can't cd to a file. – gbarry – 2010-12-10T03:08:38.760
Migrate this question to Super User? – Peter Mortensen – 2011-01-22T09:47:21.147