QCMD(1)
π bestie, you've landed on QCMD(1), fresh from the General Commands Manual. grab a snack, this one's a long one and we're doing it properly.
π NAME π
qmv, qcp β rename or copy files quickly, by editing the file names in a text editor. no cap.
β¨ SYNOPSIS β¨
qcp [OPTION]... [FILE]...
qmv [OPTION]... [FILE]...
qcmd --command=COMMAND [OPTION]... [FILE]...
π DESCRIPTION π
okay so this manual page documents the qcp, qmv and qcmd commands. three icons, one page.
The qmv program lets you rename files by editing their names in any text editor. like, literally β change a letter in a text document, and a letter in a filename gets changed. and because the files are listed one after the other, common changes can be made so much faster. it's giving bulk-rename main character energy. π
The qcp program works exactly like qmv, except it copies files instead of moving them.
The qmv program was built with safety in mind β bogus renames caused by human error are avoided by performing as many checks as possible. because of this, qmv supports an interactive mode where each step in the rename procedure can be executed manually. the default is to start qmv in non-interactive mode. BUT β when there's a conflict or an error, qmv will drop to interactive mode (instead of losing all your user-made changes, bestie, we would never π). for more info on the renaming process and interactive mode, see below. this also applies to qcp.
The qcmd program works just like qmv and qcp, but it lets you specify which command to execute. choose your own adventure fr fr.
The ls(1) program is used to list files to rename or copy. therefore qmv, qcp, and qcmd accept some ls options.
π¦ RENAMING/COPYING PROCESS π¦
The process of renaming or copying files is made of many steps. they are:
- List files β generate a list of files to rename from the command-line arguments, by using
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 the updated file names.
- Check rename and reorder to resolve conflicts (qmv only) β this is a complicated step which involves the following tasks:
- Tag renames where the destination file already exists, renames where the old file is now missing or inaccessible, and renames where the new name was not changed.
- Perform a topologic sort on the renames, so that renaming
b->c,a->bis possible. - Resolve cross references by renaming into temporary names, so that renaming
e->f,f->e(ore->f,f->g,g->eand so on) is possible.
This step results in a plan of renames.
- Display the plan. β display the plan to the user.
- Apply the plan. β apply the plan by actually renaming or copying files (unless
--dummywas specified).
If an error occurs during any of the above steps (except the first), qmv/qcp drops the user into the interactive mode. this way no changes should be lost, and errors can be corrected manually before continuing. see below for a description of the interactive mode. π«Ά
π OPTIONS π
These programs follow the usual GNU command line syntax, with long options starting with two dashes (-).
-a,--allβ (passed tols.) do not hide entries starting with..-A,--almost-allβ (passed tols.) do not list implied.and...-B,--ignore-backupsβ (passed tols.) do not list implied entries ending with~.-cβ (passed tols.) sort by ctime (time of last modification).--command=COMMANDβ executeCOMMANDinstead ofmvorcp.-d,--directoryβ (passed tols.) list directory entires instead of contents.-r,--reverseβ (passed tols.) reverse order while sorting.-R,--recursiveβ (passed tols.) list subdirectories recursively.-Sβ (passed tols.) sort by file size.--sort=WORDβ (passed tols.) sort by extension (-X), none (-U), size (-S), time (-t), version (-v), status (-c), time (-t) again (yes it really says time twice, that's just how it is π), atime (-u), or access (-u).--time=WORDβ (passed tols.) if sorting is done by time (--sort=time), sort by atime, access, use, ctime or status time.-tβ (passed tols.) sort by modification time.-uβ (passed tols.) sort by access time.-Uβ (passed tols.) do not sort; list entries in directory order.-Xβ (passed tols.) sort alphabetically by entry extension.-f,--format=FORMATβ change the edit format of the text file. see below for possible values.-o,--options=OPTIONSβ pass options to the selected edit format.OPTIONSis in the format
OPTION[=VALUE][,OPTION[=VALUE]...]
for a list of available options for each format, use --options=help or see below.
-i,--interactiveβ start in command mode (see below for information on this mode).-e,--editor=PROGRAMβ specify the program to edit the text file with. the default program is determined by looking at theVISUALenvironment variable, or if that is not set, theEDITORenvironment variable. if that is not set either, use the program callededitor.--ls=PROGRAMβ specify the path of thelsprogram. if you omit the directory, the executable will be searched for in the directories specified by thePATHenvironment variable.-v,--verboseβ be more verbose about what is being done.--dummyβ do everything as usually, except actually renaming any files ("dummy" 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 necessary 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 dc), and destination-only (or do). the default format is dual-column.
π DUAL-COLUMN FORMAT π
The dual-column format (dual-column or dc) displays files in two columns. this is the default and recommended format. the leftmost column is usually the source file name (which should not be edited), and the rightmost column the destination file name.
Supported options:
swapβ swap the location of the old and new names when editing. i.e. the leftmost column is now the destination file name, and the rightmost the source file name.separateβ put a blank line between all renames.tabsize=SIZEβ by default, tab characters of size8are used to separate the columns. with this option the width of these tab characters can be changed.spacesβ use space characters instead of tab characters when indenting.width=WIDTHβ this option specifies the character position (horizontally) which the second file name starts at.autowidthβ normally, if the source file name is longer than width characters, the destination name is printed on the next line instead. with this option enabled however,qmv/qcpwill adjust the width so that source and destination file names can be displayed on one line.- if a width has been specified with
widthprior toautowidth, that width will be used as a minimum width. - Example: assume that
width=10,autowidthis specified. even if all source file names are shorter than five characters, the split width would be10. if there had been one file name longer than10characters, the final width would have been more than10characters. - this option is enabled by default.
- if a width has been specified with
indicator1=TEXTβ text to put before the first file name (column).indicator2=TEXTβ text to put before the second file name (column).helpβ show summary of edit format options.
π§ SINGLE-COLUMN FORMAT π§
The single-column format (single-column or sc) displays files in a single column β first the source file name, and on the next line the destination file name.
Supported options:
swapβ swap the location of the old and new names when editing. i.e. the first line 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β show summary of edit format options.
π DESTINATION-ONLY FORMAT π
The destination-only format (destination-only or do) displays files with only the destination file name, one on each line. this format is generally not recommended, since the only way to identify the source 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 β¨
Okay bestie, so when you're in interactive mode, qmv/qcp is literally just sitting there reading commands off your keyboard, parsing them, and running them. The whole thing is powered by GNU readline, so your muscle memory from the shell? It works. π
Here are all the commands you can throw at it:
ls,list [OPTIONS].. [FILES]..β picks the files you wanna rename. Don't name any files? It just grabs every single file in the current directory. The options it takes are the same ones you'd hand tols(1)β runhelp lsto see the whole list of them.import FILEβ loads the files to rename out of a text file. Each line should be an existing file you want to rename.ed,editβ opens your renames up in a text editor. Heads up: if you've already run this command before and you don't sayall, it'll only edit the renames that have errors.planβ shows you the current rename-plan. (This plan is what gets created afteredit.)applyβ actually applies the current plan, i.e. renames the files. Only the ones marked as OK in the plan get renamed, no cap.retryβ if some rename failed earlier while you were runningapply, this one goes back and tries those renames again. π«Άshowβ displays the value of the configuration variable you name, or all of them if you don't name one. Full list of variables is down below.set VARIABLE VALUEβ sets the value of a configuration variable.exit,quitβ leaves the program. β οΈ But if you've got unapplied changes floating around, it'll tell you so, and you'll have to run this command one more time to actually get out.help [ls|usage]β saylsand it shows you the list options. Sayusageand it shows the accepted command line options. Say nothing and it gives you help on the interactive mode commands.versionβ shows version info, obviously. π
π¦ VARIABLES π¦
These are the variables you get in interactive mode:
dummy BOOLEANeditor STRINGformat STRINGoptions STRINGβ these variables match up with the options of the same name.tempfile STRINGβ this one holds the name of the temporary file that gets edited withedit. You cannot set it; you can only read it withshow.
How do you write these? A boolean value gets written as 0, false, no, off, or 1, true, yes, and on. Strings get written without quotes, bestie. πΈ
π« EXAMPLES π«
Edit the names of files in the current directory:
qmv
Edit names of files with extension .c. Sort files by modification time:
qmv -t *.c
Edit names of files using the nedit editor and with column width 100:
qmv -enedit -owidth=100
π REPORTING BUGS π
Found a bug? Report it to <oskar@osk.mine.nu>. Be nice about it, okay? π₯Ί
π AUTHOR π
The author of renameutils and this manual page is Oskar Liljeblad <oskar@osk.mine.nu>. Iconic behaviour, honestly.
π COPYRIGHT π
Copyright Β© 2001, 2002, 2004, 2005, 2007, 2008, 2011 Oskar Liljeblad
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π¨ Like, none. Zero. Zip.
And that's a wrap on this page, bestie! This was qcmd from renameutils, dated December 4, 2007. Go forth and rename responsibly. πβ¨
π¦ where this page comes from
- arch rolling: renameutils 0.12.0-8 Β· GPL-3.0-or-later
- debian bookworm: renameutils 0.12.0-10 Β· GPL-3.0-or-later
- debian trixie: renameutils 0.12.0-12 Β· GPL-3.0-or-later
- fedora 43: renameutils 0.12.0-30.fc43 Β· GPL-3.0-or-later
- fedora 44: renameutils 0.12.0-31.fc44 Β· GPL-3.0-or-later
- nixos 26.05: renameutils 0.12.0
- nixpkgs unstable: renameutils 0.12.0
- ubuntu jammy: renameutils 0.12.0-9 Β· GPL-3.0-or-later
- ubuntu noble: renameutils 0.12.0-11build2 Β· GPL-3.0-or-later
- ubuntu questing: renameutils 0.12.0-12
- ubuntu resolute: renameutils 0.12.0-13 Β· GPL-3.0-or-later
- ubuntu stonking: renameutils 0.12.0-13 Β· GPL-3.0-or-later
- Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008 Oskar Liljeblad
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms