Changes

Advanced Shell Operations

575 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* [[Advanced Shell Operations]]* [[Console Command Examples]]* [[Advanced Shell Operations]]
Bureaucrat, administrator
16,192
edits