by | | 0 comment(s)

Making sense of the Windows 10 console: newbie edition


For those of you who are not power users, Windows 10’s interface has been improved leaps and bounds ahead of any previous version of Windows. Even better, Windows 10 allows for voice activated features through the integration of Cortana, making it even easier to find and open files, desktop programs and Windows Store apps.

With that said, power users who want a little more control using a command line, will find that Windows 10 offers some pretty advanced features that not only let users interact using Microsoft’s own Command Prompt and Windows Powershell, but also other command shells such as Bash, which has been recently included in Windows 10 Insider Preview, as of build 14316. For those who aren’t in the loop of what has unfolded since the Microsoft Build event, the tech giant has managed to integrate a subsystem, within Windows 10, in which a full version of Ubuntu Linux can be accessed and can also interact with its host system, natively.

While, for the time being, Bash is only available to Windows 10 Insiders, regular users will have access to Bash and other upcoming shells, as of Windows 10 Anniversary edition, due this Summer. All of this is well and good, but some of you may still wonder...

...I’m a newbie: what the heck is a Shell??

Command shells are not required to make use of an operating system like Windows 10, in fact most regular users are barely aware of the Windows console, also known as that “scary little black window with white text that i better just leave alone”.

Windows 10 console prompt

While it’s true that most users will never need to open a console window, at least not on purpose, it won’t hurt to at least understand the basic concepts, and reasons why consoles can be useful, and even fun to use, for those who take the time to delve into them.

A command shell, also known as “command prompt”, or “console”, is a program designed to allow users to perform tasks, such as moving files and folders across the file system, run programs, and even code and compile applications, which is why shells are popular among program developers.

To access a console in Windows 10, the quickest way is to right-click on the Start button, and then click on either Command Prompt, or Command Prompt(Admin), which gives the user elevated privileges.

If this is your first rodeo, choosing Command Prompt would be wiser. The first thing you’ll see upon opening a Windows console is a black window with “C:\WINDOWS\system32>” in white text.

Getting help

When using a regular Windows program with a graphical interface, getting help is easy. All you have to do is finding your way through a menu, and clicking “help”.

When using a console, help is still available, but in a different way.

For a general overview of all commands available in the Windows console, typing “help” will return a complete list of commands you can use, with a brief description next to them.

Some commands may not be as easy to understand, as others, so here is a few you can try, without doing any harm to the system:

  • Time - displays and sets the system’s current time
  • Date - displays and sets the system’s current date
  • Dir - lists all files and folders in the current location
  • Cls - clear all text in the console window
  • Color - sets the color of the text and the background of the console window
  • Systeminfo - displays the current system’s information, including OS information and integrated hardware
  • Tasklist - lists all programs that are currently running
  • Tree - shows the folder structure of a drive or a location on the hard drive
  • Ver - shows the current version of the operating system

Nearly all commands come with a quick explanation and sample usage, which can be displayed by typing a command followed by “/?” (without quotes). Using /? After a command will not execute it.

What about Bash?

Bash is a Linux-based command shell, and just like the Windows console, it’s built to perform operations by typing commands into it.

As mentioned earlier, Bash is part of Ubuntu Linux, which is integrated into Windows 10. To access Bash, all we need to do is open a Windows console, and type “bash”, which will initiate the Bash shell, ready to accept commands.

Bash shell in Windows 10 Powershell

Similarly to the Windows console, Bash uses a help system that lets you understand more about the commands available. With that said, typing “help” in Bash will only give you a list of commands, without much explanation on what they do, which is where the “man” comes in.

“Man”, in Bash, as well as in Linux, stands for “Manual”, and it’s a comprehensive help system that offers detailed instructions on how to use different commands. Typing “man bash” for example, will return a comprehensive explanation of Bash, what it does, and how to use it, as well as instructions on how to navigate the manual itself.

What can you do with Bash

Bash in Windows 10, can do more or less anything the Windows console does. With that said, Bash can also be expanded, by installing more programs to enhance Bash’s capabilities. For example, a popular calculator application available to Ubuntu users, is “apcalc”, which is a program capable of executing all sorts of arithmetic calculations, including complex formulas.

The default method to install programs in Ubuntu is “apt-get” which is an application that allows to download and install specific programs both locally available and over the Internet.

To install apcalc, simply type “apt-get install apcalc”. This will trigger the installation automatically. Upon running the installation program, you will be asked if you want to proceed, in which case you can type “y” for yes, or “n” for no.

Once the installation is complete, we’ll just type “calc” to start the calculator, at which point we can try all sorts of equations and operations, such as: 10+(12*7)/100+(500-12+9)*10

Pressing enter will return 4980.84

To quit most applications in Bash, including apcalc, simply type "exit" and press Enter.

To remove apcalc, simply type: “apt-get remove apcalc” and press Enter. You will be asked to confirm by typing y or n and press enter.

The same method can be applied to remove other applications accessible in Bash.

Other simple things that we can do in bash are:

  • Cal - displays a calendar for the current month
  • Date - displays the current date
  • Time - displays the current time

Conclusions

While most users get by just fine with an expectation of technology becoming more intuitive and user-friendly every day, gaining an understanding of the lesser intuitive side of technology, is an opportunity to appreciate technology more deeply, and understand the nature of why computer programs work and behave the way they do.

Understanding Bash, and other command line methods that allow to “talk” with computers more directly, is one way to work towards a better understanding of how all computing devices really function, past any fancy graphical user interface.




You must be logged in to post comments.