Hands-on Lab·LPIC-1
Archives, cpio, dd, and the globs the shell expands
Objective 103.3 names tar, cpio and dd, and expects you to know what the shell does to a pattern before any of them run. This guide archives one tree four ways and measures the results, uses cpio to write, read and copy without an archive, copies blocks with dd, and shows the same glob succeeding in one shell and refusing to run in another.
101: GNU and Unix Commands Guide 28 of 33 Beginner
- OSUbuntu 26.04 LTS
- Kernel7.0.0-30-generic
- systemd259
- TimeAbout 26 min
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC1-A01 | 192.168.0.76 | Ubuntu 26.04 LTS | Debian-family host - dpkg and apt, which objective 102.4 names | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when packaging a directory for transfer or backup, or when a command behaves differently from how you typed it. This matters because the exam names three archiving tools with different syntax, and because globbing is done by the shell - so the command you ran is not always the command you wrote.
- checking which compressors a machine actually has before relying on one
- creating, listing and extracting a tar archive, and comparing four formats by size
- using cpio to write an archive, read it back, and copy a tree with no archive at all
- copying with dd by block, and reading the first bytes of a file
- using
?,[...]and[!...], and seeing an unmatched pattern handled two different ways
Before you start
- the-filters-that-process-text-streams
-
A tree to archive
-
The compressor the objective names and the machine does not have
-
tar, and the three compressors side by side
-
cpio, which the objective names and nobody uses
-
dd, which copies blocks rather than files
-
Globbing, which the shell does before the command sees anything
-
Putting the machine back