logo

utils-std

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

truncate.1 (1562B)


  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-04-23
  5. .Dt TRUNCATE 1
  6. .Os
  7. .Sh NAME
  8. .Nm truncate
  9. .Nd change the size of files
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl c
  13. .Fl r Ar ref_file
  14. .Ar file...
  15. .Nm
  16. .Op Fl c
  17. .Fl s [ Ar + Ns | Ns Ar - Ns | Ns Ar % Ns | Ns Ar / ] Ns Ar size Ns Op Ar suffix
  18. .Ar file...
  19. .Sh DESCRIPTION
  20. .Nm
  21. changes the size of each given
  22. .Ar file .
  23. Either with a size operation given via the
  24. .Fl s
  25. option or via a reference file given by
  26. .Fl r Ar ref_file .
  27. .Sh OPTIONS
  28. .Bl -tag -width Ds
  29. .It Fl c
  30. Prevent creating new files.
  31. .It Fl r Ar ref_file
  32. Set the size of
  33. .Ar file
  34. based on the file size of
  35. .Ar ref_file .
  36. .It Fl s [ Ar + Ns | Ns Ar - Ns | Ns Ar % Ns | Ns Ar / ] Ns Ar size Ns Op Ar suffix
  37. Size operation.
  38. .Bl -tag -width _ -compact
  39. .It Ar +
  40. Extend
  41. .Ar file
  42. by
  43. .Ar size
  44. .It Ar -
  45. Reduce
  46. .Ar file
  47. by
  48. .Ar size
  49. .It Ar %
  50. Round up
  51. .Ar file
  52. into a multiple of
  53. .Ar size ,
  54. useful for chunks.
  55. .It Ar /
  56. Round down
  57. .Ar file
  58. into a multiple of
  59. .Ar size ,
  60. useful for chunks.
  61. .El
  62. .Pp
  63. .Ar size
  64. is an integer optionally followed by a
  65. .Ar suffix
  66. being one of KMGTP (Kilo, Mega, Giga, Tera, ...) using power of 1024 by default, which can be either explicit via adding iB (like MiB), or turned into powers of 1000 by adding B (like MB).
  67. .El
  68. .Sh EXIT STATUS
  69. .Ex -std
  70. .Sh SEE ALSO
  71. .Xr split 1
  72. .Sh STANDARDS
  73. None known.
  74. .Sh HISTORY
  75. A
  76. .Nm
  77. utility appeared in FreeBSD 4.2.
  78. .Sh AUTHORS
  79. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me