Command-line cheat sheet¶
This page lists the most common commands in the Ubuntu command line.
For full details on any command, run man <command> in your terminal.
Working with the filesystem¶
Command |
Description |
|---|---|
|
Create a new directory |
|
Remove an empty directory |
|
Display directory structure as a tree |
|
Display tree to depth |
Working with files¶
Command |
Description |
|---|---|
|
Create a new (empty) file, or update the timestamp of an existing file |
|
Copy a file from a source ( |
|
Copy a directory recursively, preserving permissions |
|
Move or rename a file or directory |
|
Remove a file |
|
Print the contents of |
|
View file contents one page at a time |
|
Print the first 10 lines of a file |
|
Print the last 10 lines of a file |
Users, groups, and permissions¶
Command |
Description |
|---|---|
|
Change file permissions (symbolic or numeric notation) |
|
Change file owner and group |
|
Show or set the default permissions mask |
|
Run a command with administrator privileges |
|
Look up a user account |
|
Look up group membership |
Searching¶
Command |
Description |
|---|---|
|
Search for lines matching a pattern in a file |
|
Search for files matching a name pattern |
|
Show the full path to an executable command |
|
Determine the type of a file |
Getting help¶
Command |
Description |
|---|---|
|
Open the manual page for a command |
|
Open the manual page for |
|
Search man page descriptions for a keyword |
|
Print a brief help summary for a command |