Getting to Know the Linux/Macox Terminal.

 

Overview

In this blog Im an going to go over the basic commands of a Unix based kernel. Whether you are working in a Linux terminal or a Macox, the commands are very compatible. Thats because both terminal are built on a Unix based kernel, unlike the  Windows command line which is DOS-based which is nowhere near compatible.Unix is a widely used  multiuser operating system built way back when sometime the 60’s, the Unix kernel is the power house behind a lot of the operating systems we use today(It is also most commonly used by programs also). Personally I love any Unix based terminal solely just on how functional and compatible it is to any applications   regarding programming languages.Also when learning a new programming language any time you need to bust out some commands a Bash scripting is greatly advised.

  Getting to know the commands

      Working with directories 

Important!! A directory is a folder.

~$ ls

“ls” tells the computer to list all directories in your current state.

~$ cd <somedir>

“cd” or Change Directory, changes from your current directory to the where you wish to switch from.

~$ mkdir <name of dir>

“mkdir” is short for Make Directory. What this does is it creates a directory with a name you wish to call that directory.

~$ rmdir <somedir>

“rmdir” or Remove Directory. This removes the directory. Note: The directory must be empty.

Working with files

~$ cp <file.html> <file2.html>

“cp” this command copies the file in the same directory. Make sure you rename the file you can not have two files named the same.

~$ mv <file.html> ./<some_directory>/

“mv” this command move a file to a different directory.

~$ rm <somefile>

“rm” this deletes a file.

Some extra commands

~$ history

List all the past commands.

~$ who

List all who is logged on.

~$ date

Prints out the current date.

~$ df

See how much free disk space.

~$ clear

Clears the terminal.

Great!! I hope this gives a basic knowledge of Unix based commands.

Getting to know Windows CMD

       Although Windows CMD or Command Prompt is rarely used by anyone whether they are your run of the mill users or, your super high tech nerdy computer geeks. Compared to other operating systems (like Mac ox or any Linux distributions) terminals, the Windows Command prompt is like the middle child its just there (p.s. Sorry if this joke offends anyone,but I’m trying to make a point haha).

What is CMD

     First off CMD stands for Command but can be better know as a command prompt. Now we got to know CMD on a first name bases lets continue shall we. What you do in  a command prompt is just what it sounds like, its a program where you can command some set of instruction to be able to preform a task to your computer. When giving commands in the Command Prompt its important that you make sure can can speak its language. You cant just ask it to open a web browser in our English language, you have to speak what is called syntax or command-line syntax. Now Windows command-line syntax is a strict language which means it is very important that nothing is missed spelled and no spaces are left behind. At first when you open up the black screen with the high speed green text, at first sight can be a bit intimating but the concept of using windows GUI. The Windows GUI(Graphical User Interface) is  where us as users interact on a graphic interface like this one: understandos_windows

So pretty much working in the command prompt is just like it for example if you click on “My Documents” then right-click on an empty space to create a folder, how you would execute that in the command prompt would be Mkdir. So lets get start learning commands shall we.

How to get to the command prompt

To get to the command prompt on windows 10(Windows 10 because it is the current version I have) go on the bottom left of the screen and where it says “Search Windows” and type cmd and it should appear on the top. As shown on the bottom:

cmd

A Few Commands (or more)

CD – Change Directory

CD is a command that basically switches back and fourth to different files or if dig deeper you they are directory’s

cd [name of folder/file]

to go back

cd../

Dir – Directory 

Dir is a command where it list all folders or files depending where you are.

dir

navigatecmdprompt2

cls – Clear screen 

Come on its pretty self explanatory what this does.

cls

mkdir – Make Directory

This command creates a directory or folder/file with the command followed by the name you wish to create.

mkdir [name of directory]

acl_mkdirb

Important: make sure before hand that you are in the administrative command prompt or it will deny access to you using it. Here a little guidance, on the bottom left corner type cmd and right-click on the icon then you will see Run as administrator.

run-cmd-as-administrator

rmdir – Remove Directory

This removes the Directory.

rmdir [name of file/folder] 

Well thats all the basic and most used commands dealing with the command prompt.