unpack an archive
Open any common archive: tar, zip, gz, xz, 7z, rar.
archivesfiles
steps
-
tar -xf archive.tar.gzany tar: .tar, .tar.gz, .tgz, .tar.xz, .tar.zst
-
tar -xf archive.tar.gz -C /destinto another folder
-
unzip archive.zip -d foldera zip, into a folder
-
gunzip file.gza single .gz file
-
xz -d file.xza single .xz file
-
7z x archive.7z7z, and most other kinds (p7zip)
-
unrar x archive.rarrar, if unrar is installed
notes
tar -tfandunzip -llist what is inside first.
commands used
tarunzip7zgunzip
Each has a page in lore: lore tar opens it.
compress a folder
Pack a folder into one compressed file, look inside it, and unpack it again.
pack a folder without some files
Make a tar archive of a folder, leaving out folders like node_modules and files like logs.
add to the end of a file
Add lines to a file without replacing it, also to a file only root can write.
argument list too long
"Argument list too long" from rm, cp or mv: too many files for one command line. Hand them over in batches.