20 Essential Linux File Commands Explained
Navigating the command line often begins with managing files. The simple act of listing directory contents with ls, or creating a new directory with mkdir, forms the foundation of daily operations. When it comes to organizing, moving a file with mv or renaming it serves as a common task, while the precise removal of unwanted items using rm keeps the workspace tidy. These fundamental actions are the building blocks for interacting with the file system efficiently.
Every term presented here can be added to Memorabit, which sends it as a reminder at an unexpected moment. The full list follows.
| Term | Meaning |
|---|---|
| ls | Lists directory contents. |
| cp | Copies files and directories. |
| mv | Moves or renames files. |
| rm | Removes files or directories. |
| mkdir | Makes directories. |
| rmdir | Removes empty directories. |
| touch | Creates a file or changes its timestamps. |
| cat | Concatenates files and prints them to standard output. |
| head | Outputs the first part of files. |
| tail | Outputs the last part of files. |
| wc | Counts newlines, words, and bytes for each file. |
| sort | Sorts lines of text files. |
| uniq | Reports or omits repeated lines. |
| cut | Removes sections from each line of files. |
| tr | Translates or deletes characters. |
| chmod | Changes file mode bits. |
| chown | Changes file owner and group. |
| df | Reports file system space usage. |
| du | Estimates file space usage. |
| ln | Makes links between files. |