LINUX.ORG.RU

Ответ на: комментарий от sdio

прочитал (да, вот так) man rename , не соображу где там описано подобие того, что мне надо..

у меня убунта, КДЕ не хочу.

насчет mv_sed - что это? можно как-то популярно? спасибо

embk55
() автор топика
Ответ на: комментарий от embk55
RENAME(1)              Perl Programmers Reference Guide              RENAME(1)

NAME
       rename - renames multiple files

SYNOPSIS
       rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]

DESCRIPTION
       "rename" renames the filenames supplied according to the rule specified
       as the first argument.  The perlexpr argument is a Perl expression
       which is expected to modify the $_ string in Perl for at least some of
       the filenames specified.  If a given filename is not modified by the
       expression, it will not be renamed.  If no filenames are given on the
       command line, filenames will be read via standard input.

       For example, to rename all files matching "*.bak" to strip the
       extension, you might say

               rename 's/\.bak$//' *.bak

Точно прочитал? Я бы понял вопрос «как составить нужный regex?»

Но «где там описано подобие того, что мне надо?» это неуважение.

sdio ★★★★★
()
Ответ на: комментарий от sdio
RENAME(1)                                          User Commands                                          RENAME(1)

NAME
       rename - rename files

SYNOPSIS
       rename [options] expression replacement file...

DESCRIPTION
       rename  will  rename  the  specified  files by replacing the first occurrence of expression in their name by
       replacement.

OPTIONS
       -v, --verbose
              Give visual feedback which files where renamed, if any.

       -V, --version
              Display version information and exit.

       -s, --symlink
              Peform rename on symlink target

       -h, --help
              Display help text and exit.

EXAMPLES
       Given the files foo1, ..., foo9, foo10, ..., foo278, the commands

              rename foo foo0 foo?
              rename foo foo0 foo??

       will turn them into foo001, ..., foo009, foo010, ..., foo278.  And

              rename .htm .html *.htm

       will fix the extension of your html files.

WARNING
       The renaming has no safeguards.  If the user has permission to rewrite file names, the command will  perform
       the  action  without any questions.  For example, the result can be quite drastic when the command is run as
       root in the /lib directory.  Always make a backup before running the command, unless you truly know what you
       are doing.

SEE ALSO
       mv(1)

AVAILABILITY
       The   rename   command   is   part   of   the  util-linux  package  and  is  available  from  ftp://ftp.ker‐
       nel.org/pub/linux/utils/util-linux/.

util-linux                                           June 2011                                            RENAME(1)

где ты тут регулярные выражения нашел, дятел?

anarquista ★★★★★
()
Ответ на: комментарий от sdio

ты забыл уточнить, dev-perl/rename или sys-apps/rename, потому что 1 никто не пользуется. но krename это хороший совет, хоть и оверкилл, опенсорсных аналогов у него нет.

wakuwaku ★★★★
()
Ответ на: комментарий от wakuwaku

потому что 1 никто не пользуется

Это ты так смело сказал. Во всех debian-деривативах

update-alternatives --display rename
rename - автоматический режим
  ссылка сейчас указывает на /usr/bin/prename
/usr/bin/prename — приоритет 60
  подчинённый rename.1.gz: /usr/share/man/man1/prename.1.gz
Текущая «лучшая» версия: «/usr/bin/prename»
А это большая часть десктопов и серверов.

redgremlin ★★★★★
()
Ответ на: комментарий от wakuwaku

У ТС Убунта, так что «Узбагойся» у него нужный rename

sdio ★★★★★
()
Ответ на: комментарий от redgremlin

Это дебианопроблемы. Меня можно понять, убанта никогда не была моим выбором.

wakuwaku ★★★★
()
Ответ на: комментарий от sdio

в итоге простому смертному вы можете доступно сказать, как это сделать? потому что я ниче не понял

embk55
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.