Command-Line Interface¶
A command-line interface (CLI) is a text-based user interface (UI) used to run programs, manage computer files and interact with the computer1.
You can check out a more comprehensive guide made by the excellent Django Girls team. Skip to the summary for a quick refresher. Longer tutorials and even interactive ones are available.
The Windows tabs refer to PowerShell.
Tip
Press Tab at any point while typing to toggle the autocomplete: if there is only one option it will be filled, if there is more than one hit Tab again to show a list of all the possible options.
Learn more about a command¶
If for some reason Google does not work,
open the local manual page for a command:
Current directory¶
Print the path to the current directory
List all the files¶
List all the files and directories.
In the current directory:¶
In any directory:¶
Absolute vs relative paths
An absolute path is relative to the root directory of the file system
(/ for Linux, C:\ for Windows)2.
For example:
/home/pmn/repos/dsdocs.
A relative path starts from some given working directory, avoiding the need to provide the full absolute path.
In our example,
if the current directory is
/home/pmn,
to list all the files in dsdocs run
Change current directory¶
To change the current directory:
Create a directory¶
To create a directory in the current directory:
Move a file¶
Rename or move a file
-
Wikipedia: Absolute and relative paths. ↩