bmv

Batch file moving utilities
git clone git://jacobedwards.org/bmv
Log | Files | Refs | README

bmv.1 (2456B)


      1 .\"
      2 .\" Copyright (c) 2023 Jacob R. Edwards <jacob@jacobedwards.org>
      3 .\"
      4 .\" Permission to use, copy, modify, and distribute this software for any
      5 .\" purpose with or without fee is hereby granted, provided that the above
      6 .\" copyright notice and this permission notice appear in all copies.
      7 .\"
      8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
      9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     15 .\"
     16 .Dd April 13, 2023
     17 .Dt BMV 1
     18 .Os
     19 .Sh NAME
     20 .Nm bmv
     21 .Nd batch move
     22 .Sh SYNOPSIS
     23 .Nm
     24 .Op Fl 0cdflmnor
     25 .Ar list1
     26 .Op Ar list2
     27 .Sh DESCRIPTION
     28 The
     29 .Nm
     30 utility is a program which takes two lists of names delimited by
     31 lines and moves each name from the first list to it's corresponding
     32 name in the second list. As it is moved, each destination is printed
     33 to the standard output.
     34 .Pp
     35 The options are as follows:
     36 .Bl -tag -width indent
     37 .It Fl 0
     38 Use nul to delimit names instead of newline. (This also changes the
     39 output delimiter to nul.)
     40 .It Fl c
     41 Copy files using
     42 .Xr cp 1
     43 instead of
     44 using
     45 .Xr rename 2 .
     46 .It Fl d
     47 Create parent directories of destination files if they are missing.
     48 .It Fl f
     49 Only print a warning and otherwise ignore errors with file moving
     50 or directory creation.
     51 .It Fl l
     52 Use
     53 .Xr link 2
     54 instead of
     55 .Xr rename 2 .
     56 .It Fl m
     57 Use
     58 .Xr rename 2 .
     59 This is the default.
     60 .It Fl n
     61 The null action; do nothing instead of
     62 .Xr rename 2 .
     63 .It Fl o
     64 Allow overwriting of files.
     65 .Fl ( f
     66 would also allow this, but would raise errors.)
     67 .It Fl r
     68 Allow removal of files by specifying zero-length destination names.
     69 .It Fl v
     70 Shows source and destination names, but in a less useful format
     71 than the default.
     72 .El
     73 .Sh EXIT STATUS
     74 .Ex -std
     75 .Sh EXAMPLES
     76 .Pp
     77 Prefix files in the current directory with 'prefix-'.
     78 .Pp
     79 .Dl $ ls > /tmp/a && sed s/^/prefix-/ < /tmp/a | bmv /tmp/a
     80 .Pp
     81 Remove files with 'bad' contained within their name and replace
     82 'tipo' with 'typo' in the rest.
     83 .Pp
     84 .Dl $ mkfifo /tmp/x && tee /tmp/x | sed -e /bad/d -e s/tipo/typo/g | bmv -r /tmp/x
     85 .Sh SEE ALSO
     86 .Xr pmv 1 ,
     87 .Xr cp 1
     88 .Sh AUTHORS
     89 .An Jacob R. Edwards Aq Mt jacob@jacobedwards.org