The Command Line Part 1
Week 1 — The command line
The dreaded command line, yes say goodbye to those pretty GUI’s, the command line is not a pleasant site for some but an essential for any serious developer. In short the command line is essentially just a different way of interacting with your computer, but why use it when we could just have our user friendly interfaces?
Believe it or not the command line is quicker and more powerful than our GUI’s and despite looking daunting at first its not to much of a hurdle to get over. In addition to this there are in fact some programs you can only use via the command line, including additional security and networking tools.
First to open the command line, for Mac users the command line can be opened via terminal (you can easily find this searching your mac for “terminal”). For Windows users its command prompt (Type “cmd” or “command prompt” into your search bar and you should find it relatively easily ).

Now before I get ahead of myself there are some minor differences between the Windows and Mac command prompt, but the important thing to take from this is they both use the same principle. For example entering the command “date” in terminal shows us today’s date and the time zone set by the Mac in question. For windows users this shows us the current set date, then prompts us to amend it.
By default when opening your command line you will be situated in the computers home directory, it doesn't look like much but as you can see my home directory is C:\Users\Steven. If I wanted to see the content of the directory all I would need to do is type “ls” in terminal or “dir” in windows.
This will expand the folder as such;

Now say we want to change our directory, I want to access my Pictures folder, well this is super simple. This command works both on Mac’s terminal and Windows command prompt “cd” (change directory), for example “cd Pictures” will take me to the Pictures directory.
Quick tip, whilst navigating folders you can type the first letter of the folder you want to access followed by the tab key to auto complete.
What if you want to return to the previous directory (navigate backwards), well its pretty straight forward. In terminal and Windows this is done the same way. “cd..”, one dot represents the current working directory two dots represents the previous, “cd..//..” will take us back two steps and so on.
If you want to see the path to your current directory (C:\Users\Steven\Pictures) use the “pwr” command (print working directory), in windows you simply enter “cd” without passing any arguments.
Another use of the command line is to enable you to access hidden files, commonly these are hidden from the average user as they are used by the OS, changing these files by mistake could potentially have very undesirable outcomes.
To access hidden files in terminal navigate to the desired directory and use the following command ls -lA here “-l” stands for “long format” (including info such as date of creation, size), and “-A” stands for all files. These kinds of commands are often known as switches, you can string parameters together with “-”. The Windows equivalent would be dir /a:h (apposed to “-” we use instead “:”). How do you know which files are hidden and which are not?, hidden files will always begin with a “.” example “.hidden_file_name”.
Creating a new file from the command line Creating a new file from the command line is pretty simple once more. For terminal you do this using the touch command for example “touch new_file_name.txt”, windows you use cd. > (cd.> new_file_name.txt).