Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-10-30
7
Medium Priority
?
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 400 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 40

Accepted Solution

by:
evilrix earned 1600 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 84

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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
How to create a branch, fetch changes, and merge them into another branch using the EGit plugin for Eclipse.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

704 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