hi
Is there a way to sort files in the order they were created ,and move them to another directory one by one ,oldest being the first to be moved.
Thanks
Arif
ls -tr|xargs -i ksh -c "mv {} ../tmp/"
Cheers
Hi thanks for reply
I have like 5 files(*.txt) in the directory
I want to move only the oldest file in the order of creation to another directory .
I am trying to use
mv (ls -tr *.event |head -1) /arif/temp/ in bash shell
I need help to correct the syntax of this command if my idea is right .
Ok ,use:
ls -tr *.txt|head -1|xargs -i ksh -c "mv {} ../tmp/"
Thanks that was perfect
Arif