miteshn
asked on
renaming all files in a directory
Hi,
I am using Korn as my shell. I need a loop that will read all the files in my current directory and rename them by attaching the extension .log. I need to do this pretty soon, so any help early would be greatly appreciated. This might be a trivial problem, but for a newbie like me, its a huge task, and i will learn a lot.
Thanks,
idiottoo
I am using Korn as my shell. I need a loop that will read all the files in my current directory and rename them by attaching the extension .log. I need to do this pretty soon, so any help early would be greatly appreciated. This might be a trivial problem, but for a newbie like me, its a huge task, and i will learn a lot.
Thanks,
idiottoo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"to avoid , use Yuzh's solution with this fix (add maxdepth)"
Not all *nix "find" support "maxdepth",
find ./* -pune -type f
will work!
Not all *nix "find" support "maxdepth",
find ./* -pune -type f
will work!
s/-pune/-prune/g
;-)
;-)
ahoffmann,
Thanks for the correction, I kown how I miss the "r" in the 1st place, the 2nd one is
just a stupid CUT and PAST!
ok, let's run:
s/-pune/-prune/g
Cheers!
Thanks for the correction, I kown how I miss the "r" in the 1st place, the 2nd one is
just a stupid CUT and PAST!
ok, let's run:
s/-pune/-prune/g
Cheers!
and moves each file to file.log ( mv $file $file.log )