Working with Files
Command | Syntax (Example) | Description |
---|---|---|
cat | cat <file> | Most commonly used to display the contents of a file. Derived from the word "concatenate," which it also does. |
chattr | chattr <option> file | Changes the ext2 attribute of a file. Some options available only to UID 0. |
cp | cp <source> < dest> | Copies a file. |
dd | dd if=input of=output | Most commonly used to convert a file. Can be used to copy image files from one device to another device or file. |
file | file <file> | Determines the type of a given file. |
grep | grep <pattern> < file> | Searches a file or files for a specified pattern. |
gzip | gzip <name> | Compresses a file using Lempel-Ziv coding. Files compressed with this utility have a .gz suffix. |
gunzip | gunzip <name> | Decompresses a gzipped file. |
less | less <file> | |
cat ... |
Get Special Edition Using Linux®, Sixth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.