shell - Recursively strip pattern from filename? -



shell - Recursively strip pattern from filename? -

is there way me utilize find command recursively loop through directory , strip pattern filename?

for example, if have:

styles.css?c=123456

as saved file, able loop through files , match has wildcard *.css?* , turn styles.css?c=123456 styles.css.

try this:

find -type f -name '*.css*' -exec echo 'file="{}"; mv ${file} ${file%\?*} ' \; | bash

shell sed

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -