Home » Infrastructure » Unix » Move file
Move file [message #98452] Mon, 25 October 2004 08:21 Go to next message
Daxesh
Messages: 61
Registered: July 2004
Member
Hello,

I have following files in directory A

abc_1.txt

abc_2.txt

abc_3.txt

Now I want to copy the max file (abc_3.txt) to another directory called B with name abc.txt

How do I use CP command?

something like

cp abc[[max]].txt /B/abc.txt

Please help.

Thanks,

 
Re: Move file [message #98453 is a reply to message #98452] Mon, 25 October 2004 16:02 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
FIL=`ls abc_*.txt | tail -1`
cp $FIL abc.txt
Previous Topic: how to trap pl/sql error in shell script
Next Topic: List only directories
Goto Forum:
  


Current Time: Mon Nov 25 21:35:24 CST 2024