Skip to content

Instantly share code, notes, and snippets.

@zakrodionov
Last active October 17, 2019 06:16
Show Gist options
  • Save zakrodionov/8248eb542dcb74183e30953a869adadf to your computer and use it in GitHub Desktop.
Save zakrodionov/8248eb542dcb74183e30953a869adadf to your computer and use it in GitHub Desktop.
Замена символов переименование полезные команды#regexp
for f in *\ *; do mv "$f" "${f// /_}"; done --удаляет пробелы в названии файлов
for a_file in *;do mv -v "$a_file" `echo "$a_file" | tr [:upper:] [:lower:]` ;done; ---делает lowercase
rename 's/[\(\)]//g' *.txt переименует все файлы .txt, удалив круглые скобки.
rename 's/[\-]//g' *.jpg удалив минус(-).
for file in *; do mv "$file" `echo $file | tr '-' '_'` ; done - замена - на _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment