Solved

What's the Difference Between a VI, the Command Prompt and a Shell

Posted on 2016-10-30
7
49 Views
Last Modified: 2016-10-31
I know of the Command Prompt, as far as some of the basic commands you can execute with it like ping and ipconfig. Bottom line: It's a powerful tool that you can use to manipulate your Windows OS and Applications that go beyond what you can typically do with your typical point and click interface.

The Command Prompt was the predecessor to the PowerShell. PowerShell represented a new and improved version of the Command Prompt (http://www.howtogeek.com/163127/how-powershell-differs-from-the-windows-command-prompt/)

But here's where I start getting lost...

For the very first time, I'm having to edit a file using VI. I'm in a Cygwin environment and without ever stopping to take an inventory of what kind of tool I'm actually using, when I boot up Vagrant, I'm using, what I'm assuming to be a Shell for Vagrant:

terminal screen shot
According to the way the app is entitled, this is a Terminal. But I can execute a VI command from this interface as well as boot up Vagrant.

Does that make it a Text Editor?

And is there a different between what is a Shell and the PowerShell?

I use Command Prompt to run GIT commands. But I can also run GIT commands through the Vagrant terminal...

Tell me if this is right:

Because I can boot up Vagrant, run GIT commands and edit files using VI commands, the Cygwin terminal demonstrates that you don't need a separate application to run all three programs. It's not accurate to refer to the Cygwin terminal as a Text Editor, because it's not Notepad and it's capable of so much more. But what do you call it? Is it a Terminal? Is it a Console?

And I'm assuming that Command Prompt and Powershell are unique when compared to the Cygwin Terminal in that you probably couldn't control the Windows OS or Windows applications  from it.

And I've also see "Shell" to mean something that controls a specific application using a Command Prompt looking console.

So...

What am I using when I open up the Cygwin Terminal? Is it a Shell? What do you call it? And at what point can you expect a "terminal-esque" application to not respond to a GIT command or a VI command?

Seems like you've got different commands, different languages and, in some instances, different interfaces.

What's the difference?
0
Comment
Question by:brucegust
  • 3
  • 2
  • 2
7 Comments
 
LVL 40

Expert Comment

by:evilrix
ID: 41866322
A shell is a program that runs to provide you the ability to communicate with the computer. Command line is just one type of shell, and there are many command line shells. Windows uses DOS and Linux software (and Cygwin) normally uses bash. Vi is a text editor.
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 41866378
A text editor must be able to load, edit, and save files.  The 'command line' is provided by the 'shell' which is an 'interface' between the 'terminal' input and display and the operating system.  

Now in your situation, you have at least two and maybe three layers of OS's and command shells.  It sounds like Windows is your 'base' and Cygwin runs on top of that and Vagrant and whatever OS it loads runs on top of that.
0
 

Author Comment

by:brucegust
ID: 41866795
Let me explain back to you what you've elaborated on so far:

Anytime I'm looking at either a Command Line, a PowerShell or a Cygwin interface, I am, by definition, interacting with a "shell."

Not all "shells" are equal, however. Powershell uses a different language than Command Prompt. And Command Prompt is a DOS paradigm whereas Cygwin is a Linux based dynamic.

Furthermore, while I can preface a command on the Cygwin interface with "vi" and be able to see the code of a particular page and edit the content, I can't do that as easily with Command Prompt (http://superuser.com/questions/186857/how-do-i-edit-text-files-in-the-windows-command-prompt).

And this brings me to the last request / question:

VI: Is it a separate shell or is it merely another family of commands that you can execute within a shell, provided you're in a Linux based format?

Or are there shells out there that are designed to be primarily text editors?

BTW: I appreciate your patience and indulgence. Even if these questions appear ridiculously rudimental, I want to understand what's in front of me. Thanks!
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 40

Accepted Solution

by:
evilrix earned 400 total points
ID: 41866801
>> Anytime I'm looking at either a Command Line, a PowerShell or a Cygwin interface, I am, by definition, interacting with a "shell."
Correct.

>> Not all "shells" are equal
Well, not all shells are the same. They all have their own syntax and scripting languages/abilities as well as behavioral differences; however, they all set out to achieve the same objective: allow you to interface with the computer. In the strictest sense, even Windows has a shell, it just happens to be explorer.exe.

>> Furthermore, while I can preface a command on the Cygwin interface with "vi" and be able to see the code of a particular page and edit the content, I can't do that as easily with Command Prompt

Well, cygwin comes with vi installed. If you want to do the same from DOS you should install ViM (Vi Improved).

http://www.vim.org/

>> VI: Is it a separate shell

Vi/Vim are just applications and when you type the command into the shell (or double click the icon in the Windows "shell", all you are doing is executing it). You can start (nearly) any application from the command shell as long as it's in your PATH, or you type the full path to the command.

https://en.wikipedia.org/wiki/PATH_(variable)

>> Or are there shells out there that are designed to be primarily text editors?

Not really (although, some would argue that Emacs is both a shell and a text editor). A shell is a shell, and application is an application. Vi/ViM are applications.

>> I appreciate your patience and indulgence

No worries.
0
 

Author Comment

by:brucegust
ID: 41866802
A VI Editor is a "Terminal Application."
A Shell is a "Terminal Application."
Command Prompt is a "Terminal Application."

http://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi/

They're all "Terminal Applications." What distinguishes one from another is the platform they're written in (Windows or Linux). Generally speaking, you can execute GIT commands on any Terminal Application. You can also edit files in a Terminal Application, but you'll need to use different commands depending on the platform you're interacting with.

Correct?
0
 

Author Closing Comment

by:brucegust
ID: 41866945
Excellent!

Thank you, gentlemen!
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 41866949
Command prompt normally comes from the Shell that is currently running.  "Terminal Application" is almost too generic to be informative since it means almost anything that shows up in the terminal.  VI is a text editing program that is started in the terminal and uses it to view and edit the text file that was loaded.
0

Featured Post

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now