Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Unix >> Solaris >> How to rename multiple files

Example 1 ========= From ---- springerlink.txt springerlink.xml To -- springerlink_batchactivate.txt springerlink_batchactivate.xml By -- # for f in springerlink.*; do [ -s $f ] && ext=`ls -a $f | cut -f2 -d .` && mv $f springerlink_batchactivate.${ext};done Example 2 - rename all the specified S* startup scripts to NEWS* ========= # cd /etc/rc3.d # for file in S*samba S*nfs.server S*kdc.master S*kdc \ S*apache S*snmpdx S*volmgt S*dhcp; do [ -s $file ] && mv $file .NEW$file done Example 3 - to rename to something with underscore ========= # for file in log.*; do [ -s $file ] && mv $file ${file}_NEW;done curly braces enclose the variable name as it needs to append to a text beginning with _ (underscore) Example 4 - prefix log.batch* files with sciencedirect_ ========= # for f in log.batch*; do [ -s $f ] && mv $f sciencedirect_$f;done
[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]