Storage, archives and resources
Check disk and memory capacity, measure project size, create an archive, inspect it, and calculate a checksum.
Explanation
Capacity and usage
df reports free space on a mounted filesystem. du measures files below a directory. They answer different questions: a filesystem may be nearly full even when your project is small, and a user quota may block writes even when df shows free space.
Commands you will use
| Command | What it does | Example |
|---|---|---|
df |
Shows filesystem capacity. | df -h "$HOME" |
du |
Measures directory or file usage. | du -sh project/ |
free |
Shows memory and swap usage. | free -h |
lsblk |
Lists block devices and mount points. | lsblk |
tar |
Creates or reads an archive. | tar -czf evidence.tgz evidence/ |
gzip / gunzip |
Compresses or expands one file. | gzip report.txt |
sha256sum |
Calculates an integrity checksum. | sha256sum evidence.tgz |
An archive groups files. Compression reduces the archive size when the data can be compressed. Inspect archive member paths before extraction; reject unexpected absolute paths or .. entries.
Worked example
cd "$HOME/asic-linux-practice"
df -h .
du -sh .
free -h
tar -czf evidence.tgz logs source
tar -tzf evidence.tgz
sha256sum evidence.tgz > evidence.tgz.sha256
sha256sum -c evidence.tgz.sha256
Expected result: tar -t lists the archived files without extracting them, and the final checksum check reports OK.
RTL/DV use
Waveforms and regression logs can grow quickly. Check df before a large run and use du to locate project directories consuming space. Archive only the evidence required for review; avoid packaging generated data that can be recreated.
Common mistakes
- Confusing filesystem free space from
dfwith project size fromdu. - Extracting an unknown archive without listing it first.
- Treating a checksum from an untrusted source as proof of authenticity.
- Archiving huge waveform files without checking whether they are required.
Check yourself
Why can df report free space while your account still cannot create a file?
Practice: Storage, archives and resources
Create an archive of your practice workspace, list its contents, save a SHA-256 checksum, and verify it.
Practice work is non-certified and is not stored by ASIC Campus.