If you wanted to view the files within that archive (without decompressing and extracting), you could issue the common tar -ztvf and tar would list out the contents for you.Īnd that’s pretty much all you have to do to compress a folder from the command line with tar. You could then decompress that new file with the command tar -xvzf. The tar portion of the extension means the file is a tar archive and the gz indicates it’s been compressed. The options we used are z (for compress), c (for create), v (for verbose output), and f (for force).Īfter running the command, you’ll find the newly created. The command we’ll run is tar -zcvf TEST. SEE: Rust: What developers need to know about this programming language (free PDF) (TechRepublic) To do this, log into your Linux machine and change into the directory housing the TEST folder. Let’s say you have a folder named TEST and you want to compress it into a single file so you can more easily send it to someone or save it as a backup. You turn to the tar command, which makes short shrift of converting folders into compressed files. But what if you’re on a headless server? A Linux without a GUI isn’t going to offer you a point-and-click affair. Sure, you could open a file manager, right-click a folder, and select Compress. Take, for instance, the task of compressing a folder. SEE: 5 Linux server distributions you should be using (TechRepublic Premium) Open source: Must-read coverageĦ Best Linux project management software in 2023Ħ best open-source kanban boards for managing projects in 2023Ħ Best Free Alternatives to Microsoft Word (2023 Update) And although a GUI might make some of the tasks a bit easier, the simplicity of doing your work in a terminal window is about as elegant a solution as you’ll find. From the CLI there’s next to nothing you can’t do. The Linux command line is an incredibly powerful tool. The TAR format is used to store multiple files into one archive, while GZIP is used to compress the data in the archive to reduce its size.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |