[JM:01577] [POST:DP] util-linux rename.1

Back to archive index
Yuichi SATO ysato****@ybb*****
2019年 8月 2日 (金) 22:32:58 JST


<STATUS>
stat: DP
ppkg: util-linux
page: rename.1
date: 2019/08/02
mail: ysato****@ybb*****
name: SATO Yuichi
</STATUS>

.\" Written by Andries E. Brouwer (aeb****@cwi*****)
.\" Placed in the public domain
.\"
.\" Japanese Version Copyright (c) 2001-2019 Yuichi SATO
.\"         all rights reserved.
.\" Translated Sat Feb 10 23:44:40 JST 2001
.\"         by Yuichi SATO <sato****@compl*****>
.\" Updated & Modified Sun Mar  2 16:53:37 JST 2003
.\"         by Yuichi SATO <ysato****@yahoo*****>
.\" Updated & Modified Tue Jul 30 20:00:01 JST 2019
.\"         by Yuichi SATO <ysato****@ybb*****>
.\"
.TH RENAME 1 "June 2011" "util-linux" "User Commands"
.\"O .SH NAME
.SH 名前
.\"O rename \- rename files
rename \- ファイル名を変更する
.\"O .SH SYNOPSIS
.SH 書式
.B rename
[options]
.IR "expression replacement file" ...
.\"O .SH DESCRIPTION
.SH 説明
.\"O .B rename
.\"O will rename the specified files by replacing the first occurrence of
.\"O .I expression
.\"O in their name by
.\"O .IR replacement .
.B rename
は、指定したファイル名において
.I expression
に最初にマッチする部分を
.I replacement
で置き換える。
.\"O .SH OPTIONS
.SH オプション
.TP
.BR \-s , " \-\-symlink"
.\"O Do not rename a symlink but its target.
シンボリックリンクではなく、シンボリックリンクの参照先を変更する。
.TP
.BR \-v , " \-\-verbose"
.\"O Show which files were renamed, if any.
対象が存在する場合、どのファイルが変更されるかを表示する。
.TP
.BR \-n , " \-\-no\-act"
.\"O Do not make any changes; add
.\"O .B \-\-verbose
.\"O to see what would be made.
変更を行わない。
.B \-\-verbose
と組み合わせて何が行われるかを見ることができる。
.TP
.BR \-o , " \-\-no\-overwrite"
.\"O Do not overwrite existing files.  When
.\"O .B \-\-symlink
.\"O is active, do not overwrite symlinks pointing to existing targets.
既存のファイルを上書きしない。
.B \-\-symlink
が指定された場合、シンボリックリンクに既存の参照先があるときは、
上書きしない。
.TP
.BR \-i , " \-\-interactive"
.\"O Ask before overwriting existing files.
既存のファイルを上書きする前に尋ねる。
.TP
.BR \-V , " \-\-version"
.\"O Display version information and exit.
バージョン情報を表示して、終了する。
.TP
.BR \-h , " \-\-help"
.\"O Display help text and exit.
ヘルプを表示して、終了する。
.\"O .SH EXAMPLES
.SH 例
.\"O Given the files
.\"O .IR foo1 ", ..., " foo9 ", " foo10 ", ..., " foo278 ,
.\"O the commands
ファイル
.IR foo1 ", ..., " foo9 ", " foo10 ", ..., " foo278
を与えると、
.RS
.PP
.nf
rename foo foo00 foo?
rename foo foo0 foo??
.fi
.PP
.RE
.\"O will turn them into
.\"O .IR foo001 ", ..., " foo009 ", " foo010 ", ..., " foo278 .
というコマンドは、ファイル名を
.IR foo001 ", ..., " foo009 ", " foo010 ", ..., " foo278
に変換する。

.\"O And
そして、
.RS
.PP
.nf
rename .htm .html *.htm
.fi
.PP
.RE
.\"O will fix the extension of your html files.
というコマンドは、html ファイルの拡張子を修正する。

.\"O Provide an empty string for shortening:
名前を短くするために空文字列を指定する:
.RS
.PP
.nf
rename '_with_long_name' '' file_with_long_name.*
.fi
.PP
.RE
.\"O will remove the substring in the filenames.
というコマンドは、ファイル名から部分文字列を削除する。
.\"O .SH WARNING
.SH 警告
.\"O The renaming has no safeguards by default or without any one of the options
.\"O .B \-\-no-overwrite\fR,
.\"O .B \-\-interactive
.\"O or
.\"O .B \-\-no\-act\fR.
デフォルトでは名前の変更には安全策はない。
安全に使うためには、
.BR \-\-no-overwrite\fR ,
.BR \-\-interactive ,
.B \-\-no\-act\fR
のいずれかを使うこと。
.\"O If the user has
.\"O permission to rewrite file names, the command will perform the action without
.\"O any questions.  For example, the result can be quite drastic when the command
.\"O is run as root in the /lib directory.  Always make a backup before running the
.\"O command, unless you truly know what you are doing.
ユーザがファイル名を書き換える権限がある場合、
このコマンドは何も質問せずに実行される。
例えば、このコマンドを root で /lib ディレクトリで実行した場合、
結果はとても強烈なことになるだろう。
自分が何をやっているか本当に分かっていない場合、
コマンドを実行する前に常にバックアップを取ること。
.\"O .SH INTERACTIVE MODE
.SH 対話モード
.\"O As most standard utilities rename can be used with a terminal device (tty in
.\"O short) in canonical mode, where the line is buffered by the tty and you press
.\"O ENTER to validate the user input.  If you put your tty in cbreak mode however,
.\"O rename requires only a single key press to answer the prompt.  To set cbreak
.\"O mode, run for example:
.\"Osato:
.\"Osato: この訳文は自信なし。
.\"Osato:
最も標準的なユーティリティとして、rename は端末デバイス (tty と省略される) で
正式な方法で使うことができる。
行は tty でバッファされ、ユーザ入力を確かめるために ENTER を入力することができる。
一方で、tty を cbreak モードにした場合、
rename はプロンプトに応答するのにキー 1 つで済む。
cbreak モードにするには、例えば以下のように実行すること:
.RS
.PP
.nf
sh -c 'stty -icanon min 1; "$0" "$@"; stty icanon' rename -i from to files
.fi
.PP
.RE
.\"O .SH "EXIT STATUS"
.SH 返り値
.RS
.PD 0
.TP
.B 0
.\"O all requested rename operations were successful
すべての rename 操作が成功した。
.TP
.B 1
.\"O all rename operations failed
すべての rename 操作が失敗した。
.TP
.B 2
.\"O some rename operations failed
一部の rename 操作が失敗した。
.TP
.B 4
.\"O nothing was renamed
なにもファイル名が変更されなかった。
.TP
.B 64
.\"O unanticipated error occurred
予期しないエラーが発生した。
.PD
.RE
.\"O .SH "SEE ALSO"
.SH 関連項目
.BR mv (1)
.\"O .SH AVAILABILITY
.SH 入手方法
.\"O The rename command is part of the util-linux package and is available from
.\"O https://www.kernel.org/pub/linux/utils/util-linux/.
rename コマンドは、util-linux パッケージの一部であり、
https://www.kernel.org/pub/linux/utils/util-linux/
から入手できる。



linuxjm-discuss メーリングリストの案内
Back to archive index