logo

utils-std

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

mv.1 (1660B)


  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 EXIT STATUS
  82. .Ex -std
  83. .Sh STANDARDS
  84. .Nm
  85. should be compliant with the
  86. IEEE Std 1003.1-2024 (“POSIX.1”)
  87. specification.
  88. .Pp
  89. The
  90. .Fl n ,
  91. .Fl t Ar destdir
  92. and
  93. .Fl v
  94. options are extensions.
  95. .Sh HISTORY
  96. A
  97. .Nm
  98. command appeared in
  99. .At v1 .