logo

utils-std

Collection of commonly available Unix tools

mv.1 (1605B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .Dd 2024-05-10
  5. .Dt MV 1
  6. .Os
  7. .Sh NAME
  8. .Nm mv
  9. .Nd move and rename files
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl f Ns | Ns Fl i Ns | Ns Fl n
  13. .Op Fl v
  14. .Ar source
  15. .Ar destfile
  16. .Nm
  17. .Op Fl f Ns | Ns Fl i Ns | Ns Fl n
  18. .Op Fl v
  19. .Ar source...
  20. .Ar destdir
  21. .Nm
  22. .Op Fl f Ns | Ns Fl i Ns | Ns Fl n
  23. .Op Fl v
  24. .Fl t Ar destdir
  25. .Ar source...
  26. .Sh DESCRIPTION
  27. In the first form,
  28. .Nm
  29. moves each given
  30. .Ar source
  31. to
  32. .Ar destfile .
  33. This form is assumed when
  34. .Ar destfile
  35. does not refers to an existing directory, or a symlink pointing to one.
  36. Additionally, in this case a trailing slash and
  37. .Ar source
  38. not referring to a directory results in an error.
  39. .Pp
  40. In the second and third form,
  41. .Nm
  42. moves each given
  43. .Ar source
  44. into
  45. .Ar destdir
  46. with appending the
  47. .Ar source
  48. basename to
  49. .Ar destdir
  50. to create the full destination path.
  51. .Sh OPTIONS
  52. .Bl -tag -width _f
  53. .It Fl f
  54. Force, do not ask before overwriting to the destination path.
  55. Overrides previously set
  56. .Fl i
  57. and
  58. .Fl n
  59. options.
  60. .It Fl i
  61. Interactive, causes
  62. .Nm
  63. to ask before overwriting a file.
  64. Overrides previously set
  65. .Fl f
  66. and
  67. .Fl n
  68. options.
  69. .It Fl n
  70. No-clobber, never overwrite.
  71. Overrides previously set
  72. .Fl f
  73. and
  74. .Fl i
  75. options.
  76. .It Fl t Ar destdir
  77. Set the destination directory.
  78. .It Fl v
  79. Verbose, write which action has been done.
  80. .El
  81. .Sh STANDARDS
  82. The
  83. .Nm
  84. utility is expected to be
  85. .St -p1003.2
  86. compatible.
  87. The
  88. .Fl n ,
  89. .Fl t Ar destdir
  90. and
  91. .Fl v
  92. options are extensions.
  93. .Sh HISTORY
  94. A
  95. .Nm
  96. command appeared in
  97. .At v1 .