Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving files

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi

I have few directories and few 100 files. All these files are error messages which i would like to put in month wise. I would like to create this month dir and move all those files into it.

Ex: ls -l
MAR - Dir
APR - Dir
MAY - Dir
f1
f2...etc files

Now i would like to move all files into MAY. How can i do that. Which command i need to use.

thx in advance
 

hi,

try to do this.

mkdir MAY
for var in `ls`
do
if test ! -d ${var}
then
mv ${var} MAY
fi
done


good luck...


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top