Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!garnet.berkeley.edu!ked From: ked@garnet.berkeley.edu (Earl H. Kinmonth) Newsgroups: comp.unix.xenix Subject: Re: Filenames -- converting Message-ID: <25371@agate.BERKELEY.EDU> Date: 9 Jun 89 02:57:41 GMT References: <1011@cernvax.UUCP> <3339@cps3xx.UUCP> <655@eecea.eece.ksu.edu> <25879@beta.lanl.gov> Sender: usenet@agate.BERKELEY.EDU Reply-To: ked@garnet.berkeley.edu (Earl H. Kinmonth) Organization: University of California, Berkeley Lines: 36 In article <25879@beta.lanl.gov> srb@beta.UUCP ( Steve Berger ) writes: > > I have a directory with all the filenames in Uppercase letters. > I'd like to move them all to lowercase. > > Is there an easy way to do that? I figure there must be a way using > sed or something, but I haven't figured it out yet, and I don't want to > go thru and use mv to move each file name, that will take me forever. > > Any ideas will be appreciated. > > Steve Berger > > srb@lanl.gov There are many ways you can do this. The one given below works. It is not necessarily "efficient" except that it took me about 1 second to think it through. for i in * do T=`echo $i | tr '[A-Z]' '[a-z]` mv $i $T done If you want to do it with sed, look at the "y" command. Earl H. Kinmonth History Department University of California, Davis Davis, California 95616 916-752-1636 (2300-0800 PDT for FAX) 916-752-0776 (secretary) ucbvax!ucdavis!ucdked!cck (email) cc-dnet.ucdavis.edu [128.120.2.251] (request ucdked, login as guest)