Cononda Cervantes
Cononda Cervantes

Reputation: 68

Powershell how to abort/exit from the input command (ctrl+C UNIX equivalent)?

This is a very basic question, but I could not find the answer on the internet or on StackOverflow.

Problem description and example:

Inputting 'cd..' into the PowerShell console takes me onto a new line with this '~>' waiting for more input and I cant get out of it again.

How can I abort this command? I would like to get back to '~\Documents>'. In UNIX bash I would hit ctrl+c.

What is the equivalent to Ctrl+c in PowerShell?

Example PowerShell console:

~\Documents> cd..
~>
~> ^X$
$ : The term '$' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ $
+ ~~
    + CategoryInfo          : ObjectNotFound: ($:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I tried exit, Ctrl+c, Ctrl+X, Ctrl+Shift+c and many others... =(

Upvotes: 1

Views: 5512

Answers (1)

Sambardo
Sambardo

Reputation: 754

How can I abort this command?

It's also ctrl-c in powershell to abort

It looks like you're not actually getting stuck in line continuation though, it seems to actually be moving up a folder. Did you try running any normal commands when it shows you ~>?

As Mathias said, ~ can be used to represent $home.

Upvotes: 3

Related Questions