Académique Documents
Professionnel Documents
Culture Documents
NAME
qmv, qcp - Rename or copy files quickly, editing the file names in a text
editor
SYNOPSIS
qcp [OPTION]... [FILE]...
qmv [OPTION]... [FILE]...
qcmd --command=COMMAND [OPTION]... [FILE]...
DESCRIPTION
This manual page document describes the qcp, qmv and qcmd commands.
The qmv program allows files to be renamed by editing their names in any
text editor. By changing a letter in a text document, a
letter in a filename can be changed. Since the files are listed after eac
h other, common changes can be made more quickly.
The qcp program works like qmv, but copies files instead of moving them.
The qmv program was built with safety in mind - bogus renames caused by h
uman error are avoided by performing as many checks as
possible. Because of this, qmv supports an interactive mode where eac
h step in the rename procedure can be executed manually.
The default is to start qmv in non-interactive mode. However, when there
is a conflict or error, qmv will drop to interactive
mode (instead of losing all user-made changes). For more information
on the renaming process and interactive mode, see below.
This also applies to qcp.
The qcmd program works just like qmv and qcp but allows you to specify wh
ich command to execute.
The ls(1) program is used to list files to rename or copy. Therefore qmv,
qcp, and qcmd accepts some ls options.
RENAMING/COPYING PROCESS
The process of renaming or copying files consists of many steps. They are
:
List files
Generate a list files to rename from command-line arguments by usi
ng ls(1).
Create an editable text file
The edit format creates an editable text file with the file names.
Start the editor
Start the text editor and wait until the user has finished editing
it.
Read the edited text file
The edit format reads the edited text file now with updated file n
ames.
--command=COMMAND
Execute COMMAND instead of mv or cp.
-d, --directory
(Passed to ls.) List directory entires instead of contents.
-r, --reverse
(Passed to ls.) Reverse order while sorting.
-R, --recursive
(Passed to ls.) List subdirectories recursively.
-S
--sort=WORD
(Passed to ls.) Sort by extension (-X), none (-U), size (-S), time
(-t), version (-v), status (-c), time (-t), atime (-u),
or access (-u).
--time=WORD
(Passed to ls.) If sorting is done by time (--sort=time), sort by
atime, access, use, ctime or status time.
-t
-u
-U
-X
-f, --format=FORMAT
Change edit format of text file. See below for possible values.
-o, --options=OPTIONS
Pass options to the selected edit format. OPTIONS is in the format
OPTION[=VALUE][,OPTION[=VALUE]...]
For a list of available options for each format, use --options=hel
p or see below.
-i, --interactive
Start in command mode (see below for information on this mode).
-e, --editor=PROGRAM
Specify program to edit text file with. The default program is det
ermined by looking at the VISUAL environment variable,
or if that is not set, the EDITOR environment variable. If that is
not set either, use the program called editor.
--ls=PROGRAM
Specify path of the ls program. If you omit the directory, the e
xecutable will be searched for in the directories speci
fied by the PATH environment variable.
-v, --verbose
Be more verbose about what is being done.
--dummy
Do everything as usually, except actually renaming any files ("dum
my" mode).
--help Show summary of options.
--version
Output version information and exit.
EDIT FORMATS
An edit format is responsible for generating a text file for editing, and
parsing it once it has been edited. The default format
is dual-column, but there are other formats as well.
Not all edit formats take the same options. Therefore, it is necessa
ry to specify them using the --options (-o) option. This
option takes a list of "suboptions" similar to the -o option in mount(8).
Available edit formats are `single-column' (or `sc'), `dual-column' (or `
SINGLE-COLUMN FORMAT
The single-column format (`single-column' or `sc') displays files in a si
ngle column - first source file name and on the next
line the destination file name.
Supported options:
swap Swap location of old and new names when editing. I.e. the first l
ine will contain the destination file name, and the next
line the source file name.
separate
Put a blank line between all renames.
indicator1=TEXT
Text to put before the first file name.
indicator2=TEXT
Text to put before the second file name.
help
DESTINATION-ONLY FORMAT
The destination-only format (`destination-only' or `do') displays files o
nly the destination file name, one on each line. This
format is generally not recommended, since the only way to identify sourc
e file name is by looking at the line number. But it may
be useful with some text editors.
Supported options:
separate
Put a blank line between all renames (file names).
INTERACTIVE MODE
In interactive mode qmv/qcp reads commands from the keyboard, parses them
, and executes them. This is done using GNU readline.
The following commands are available:
ls, list [OPTIONS].. [FILES]..
Select files to rename. If no files are specified, select all file
s in current directory. The accepted options are those
which are passed to ls(1). Use `help ls' to display a list of thes
e.
import FILE
Read files to rename from a text file. Each line should correspond
to an existing file to rename.
ed, edit
Edit renames in a text editor. If this command has been run be
fore, and not `all' is specified, only edit renames with
errors.
plan
'.)
apply Apply the current plan, i.e. rename files. Only those files marked
as OK in the plan will be renamed.
retry If some rename failed earlier during `apply', this command will tr
y those renames again.
show
qcmd (renameutils)
December 4, 2007
QCMD(1)