logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

mv.1 (1808B)


  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 December 28, 2025
  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 Ii Ns | Ns Fl n
  13. .Op Fl Tv
  14. .Ar source
  15. .Ar destfile
  16. .Nm
  17. .Op Fl f Ns | Ns Fl Ii Ns | Ns Fl n
  18. .Op Fl v
  19. .Ar source...
  20. .Ar destdir
  21. .Nm
  22. .Op Fl f Ns | Ns Fl Ii 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. .It Fl I
  56. Prompt for confirmation before moving a file,
  57. implies
  58. .Fl i .
  59. .It Fl i
  60. Interactive, causes
  61. .Nm
  62. to ask before overwriting a file.
  63. .It Fl n
  64. No-clobber, never overwrite.
  65. .It Fl t Ar destdir
  66. Set the destination directory.
  67. .It Fl T
  68. Always treat destination as a file.
  69. .It Fl v
  70. Verbose, write which action has been done.
  71. .El
  72. .Pp
  73. For the
  74. .Fl f ,
  75. .Fl Ii ,
  76. and
  77. .Fl n
  78. options, the last one specified determines the behavior of
  79. .Nm .
  80. .Sh EXIT STATUS
  81. .Ex -std
  82. .Sh STANDARDS
  83. .Nm
  84. should be compliant with the
  85. IEEE Std 1003.1-2024 (“POSIX.1”)
  86. specification.
  87. .Pp
  88. The
  89. .Fl I
  90. option is an utils-std original extension.
  91. .br
  92. The
  93. .Fl n ,
  94. .Fl t Ar destdir ,
  95. .Fl T ,
  96. and
  97. .Fl v
  98. options are extensions.
  99. .Sh HISTORY
  100. A
  101. .Nm
  102. command appeared in
  103. .At v1 .