Changes

Advanced Shell Operations

825 bytes added, 19:11, 21 November 2021
The following lines were added (+) and removed (-):
. . @ remove text from within filenames in a directory of files.                  @ . . All these files have a text string in the middle of their filename.  The text we want to remove from . within the file is:  WEB.x264-video. . so the file lexS01E01.WEB.x264-video.avi needs to change to lexS01E01.avi and the periods need escaped out . . for file in *; do mv "${file}" "${file/WEB\.x264-video\./}"; done . @ prepend text- to the beginning of all JPG files in a directory              @ . for f in *.JPG; do mv "$f" "text-$f"; done== Related Pages ==If what you're looking for isn't on this page, try some of these related pages:* [[Console Command Examples]]* [[Console Command Reference]]* [[Advanced Shell Operations]]* [[How Do I: A Linux Q&A]]{{:Template:Archived Entry}}[[Category:Legacy Notes]]
Bureaucrat, administrator
16,192
edits