The command line allows users to interact with the programs on a computer through a sequence of linear commands. It is found through the terminal on Mac, or the Ubuntu app for the Windows subsystem for Linux.
Some basic terminology:
Commands have the form:
$ command -flag(s) argument(s)
The $
indicates that you are working in the command line of a Unix based system and is not part of the command.
Here's some examples:
$ ls -la
$ mkdir myfolder
$ rm -r myfolder
ls
allows you to see the contents of a directory:
$ ls
myfolder1 myfolder2 myfolder3 mytext.txt
cd
changes your directory, and pwd
prints your working directory:
/home$ pwd
/home
/home$ cd myname
/home/myname$ cd ..
/home$
touch
can easily create new empty files:
$ ls
myfolder
$ touch myfile
$ ls
myfolder myfile
rm
is used to remove objects like files or directories:
$ touch myfile
$ ls
myfolder myfile
$ rm myfile
$ ls
myfolder