helloo
1
I need to copy a file example hhh.txt to the recently created directory by name flexite@latesttimestamp in the path interface/home/ ...
I couldnt get the name of recently created directory ....
first result of ls -lst ...that is ls -lst |head -2 gives the latest directory but i could not the name alone...it just shows the result....
Pls help on this regard....
not if it's specifically the last created directory...
The problem is: directories get modified when a file is created therein.
So you never know which one was the last one created per se.
This problem can be remedied by cleverly naming them with a sortable timestamp.
At any rate:
/bin/ls -ltd dir_names* | grep ^d | head -1 | read latest_dir