🖥️Command line
using this "hacker-looking" interface to access files
We can access a computer's file system using the command line:
on Mac, via an application called Terminal
on Windows, via Command Prompt
The prompt
The prompt, which appears when we load the command line app, shows us the current status:
On Mac, it may look something like: jon@Jons-Mac-mini Desktop %
:
jon@Jons-Mac-mini
(or similar) refers to the current machineDesktop
refers to the current folder%
is the prompt (this symbol may also be$
or#
depending on the system)just a way of stating our "cue" to type a command
On Windows, it may look something like: C:\projects\>
:
C:\
refers to the hard driveprojects
refers to a folder on that drive
As shorthand, we will refer to the prompt as simply $
The command
A command consists of a:
keyword
arguments (the values that follow the keyword)
For example:
From that:
the keyword
cd
(change directory) has the argumentmyfolder
which takes us to the folder called
myfolder
The commands
These commands come in handy on an everyday basis:
Command | Arguments | What it does |
---|---|---|
|
| prints the contents of a file (may not appear readable depending on the type of file) |
|
| accesses a folder (if it exists) |
|
| accesses the parent folder of the current folder |
| (none) | clears the command-line screen of its history |
| (none) | lists the files and sub-folders of the current folder |
|
| creates a directory/folder |
|
| renames ("moves") a file to a new name |
| (no arguments) | prints the path of the current folder |
|
| removes the directory/folder (if it exists) |
|
| removes the file (if it exists) |
|
| creates a new blank file |
Last updated