Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Split Archives on macOS Using Terminal

Archive splitting is a useful technique when dealing with large files that need to be transferred over networks with size limitations or stored on media with limited capacity. While this concept is often associated with Windows environments, it is equally applicable in the Apple ecosystem. On macOS, you can use built-in tools like split and zip via the Terminal to achieve archive splitting. This article will guide you through the process of splitting archives on macOS, ensuring you can manage large files efficiently.

Examples:

  1. Splitting a Large File Using split:

    The split command is a powerful utility available in macOS that allows you to split a large file into smaller chunks.

    • Step 1: Open Terminal.
    • Step 2: Navigate to the directory containing the file you want to split.
      cd /path/to/your/directory
    • Step 3: Use the split command to divide the file. For example, to split a file named largefile.zip into 100MB chunks:
      split -b 100m largefile.zip smallfile_part_

      This command will create files named smallfile_part_aa, smallfile_part_ab, etc.

  2. Creating a Split Archive Using zip:

    The zip command can be used to create a split archive directly.

    • Step 1: Open Terminal.
    • Step 2: Navigate to the directory containing the files you want to archive and split.
      cd /path/to/your/directory
    • Step 3: Use the zip command with the -s option to specify the split size. For example, to create a zip archive named archive.zip split into 100MB parts:
      zip -s 100m archive.zip file1 file2 file3

      This command will create files named archive.zip, archive.z01, archive.z02, etc.

  3. Reassembling Split Archives:

    To reassemble the split archives, you can use the cat command for files split with split or the zip command for zip archives.

    • Reassembling files split with split:

      cat smallfile_part_* > reassembledfile.zip
    • Reassembling split zip archives:

      zip -s 0 archive.zip --out reassembled_archive.zip

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.