What is the command line interface - Beginner's guide for Windows and Linux

Show table of contents


This is a guide to the Command line interface for Windows and Linux, reviewing differences, similiarities and
some examples.

== History

The command line interface CUI, CMD, CLI is actually just a text based interface
where you can type text and commands to acheive various functionalities.

The commandline has many advantages:
* FAST - It is very fast
* POWERFUL - It provides anyone the possibility to do things you could otherwise not do
* AUTOMATION - Anyone can write scripts to automate tasks
* RESOURCE FRIENDLY - It actually requires less resources than any User Interface

The commandline was the only means of display in computers since the 1960's up untill 1990's
with the advent the User Interface (UI).
The commandline was usable by only a mouse.

What is intereting about the command line is that everyone who wanted to use a computer needed to
go on a learning quest on using it and how to manipulate files and directories.
Enabling anyone to write scripts to do certain tasks thus speeding  up many daily tasks.

The CLI still remains a very important aspect of Sys Admins, Programmers and Unix/Linux users.

Because you can do many things much faster and easier than by using the User Interface.

More information and revisions can be found at https://en.wikipedia.org/wiki/Command-line_interface

== Commands
Linux has many flavours of command line interfaces the most usable and available everywhere is BASH (Bourne Again SHell).
Windows had a DOS-like interface named CMD.EXE. Microsoft introduced PowerShell - a newer and more advanced command line interface - around 2006 with windows Vista.

NOTE: you can actually use the Linux command line in Windows by installing MingW, CYGWIN or using a virtual machine.
While the CMD.exe or Powershell in Windows can acheive similair things just like on *NIX systems we recommend you learn the Linux
commandline since you will more work on LInux servers or enjoy the power of the Unix philosopy.

=== Opening the commandline in Windows
Opening the CommandLine in windows is very easy.
You either use a key combination of the Win+R and type CMD.EXE.
The Win button is the one with the Windows Logo between ALT and CONTROL on your keyboard.
You can also click on the start button and type CMD.

=== Opening the commandline in Linux
Depending on the Linux variant you have, which user interface flavour you use and many other things
you might have a different way to access the command-line.
Most Linux variants on the server already run a command line interface.

=== Getting Help
Viewing a full list of commands on both Windows and Linux:

Linux has some more commands.. this is normal since the whole filosophy of Linux is based on Unix.

Getting help with a command

dir /?

ls --help

On Linux you also have a manual for all commands with examples
man ls

=== Listing directories
Windows / Linux


=== Listing current path

=== Changing directories

=== Copying files

=== Creating files

=== Writing to a file

=== Piping

There is a free PDF Ebook Advancec Bash Scripting which details everything about the Linux commandline

Subscribe to my newsletter

NOTE:You will need to confirm your e-mail address in order to fully complete the subscription process.