0

When using the terminal, instead of typing "exit", I accidentally typed "`xit" instead.

Then the terminal entered a weird mode like this, and would't respond to anything I type:

screenshot

5
  • I don't know how to embed the picture in the post, please click the link to view the picture
    – Ray
    Jan 11, 2016 at 14:28
  • Whats the issue with Xing out or Ctl + Alt + F4
    – DnrDevil
    Jan 11, 2016 at 14:32
  • hi, thanks for your reply. note the ` symbol before the xit. So i actually typed `xit. Then the terminal became like this. I can close it only by clicking the close button. I ain't sure what Xing out is, but when I tried the hot key combination ctrl+alt+F4, I immediately enter a command-line-only mode that I don't even know how to use. All my window disappeared. I have to reboot the computer to re-enter the window mode.
    – Ray
    Jan 11, 2016 at 14:45
  • Hi, thanks for everyone that has replied to me. So basically I need another ` sign to terminate this mode and return to normal, interactive mode. BTW I'm new to ubuntu system, and this is my first post on askubuntu, and I instantly got reply! Ppl here are so helpful and willing to share their knowledge. I love this awesome Q&A platform!
    – Ray
    Jan 11, 2016 at 14:57
  • the "terminal only mode" you entered with CTRL+ALT+F4 is called a tty. You can get back to your graphical desktop by CTRL+ALT+F7
    – Wayne_Yux
    Jan 11, 2016 at 15:48

3 Answers 3

5

Short solution:
Your terminal is waiting for input. You can interrupt it with CTRL+C.


Explanation:
You typed `xit. Backticks (`) are used in bash for command substitutions (like $()). Because of the leading `, bash now expects a closing `, which is not found. This is actually a helpful feature, if you want to distribute commands over several lines, like

cat `find -name "foo*" |
> grep .txt` 
#will output the content of foo.txt

If you now type the missing `, your bash will execute your command (and probably crash, because of unknown commands). Therefore you should cancel your started command with CTRL+C and type exit again.

0
4

You can stop every process which is running in the foreground with ctrl+c which sends a kill (I think). The > is a prompt like your $ when you start a new terminal (shell), or if you type python there is a >>> prompt. This one you can exit, by typing exit or pressing ctrl+d, which sends a logout.

The prompt means you started a program which has its own prompt, instead of the shell one. I don't know what exactly the ` (backtick) starts, maybe someone can give the answer.

There are tons of those useful shortcuts.

summary:

ctrl+c = kill a process

ctrl+d = logout

2
  • 1
    I assume strg = CTRL? In any case to be precise CTRL+C doesn't really kill the foreground process, it sends a SIGINT signal to it, and CTRL+D sends a special control character known as EOF (end of file), which causes logout when run into the prompt, but that's not always the case.
    – kos
    Jan 11, 2016 at 15:09
  • Yes you are absolutely right, sorry, german keyboard
    – Kev Inski
    Jan 11, 2016 at 15:19
2

In Bash the backtick character ("`") is interpreted as the start of a command substitution.

Command substitution allows the output of a command to replace the command itself. Command substitution occurs when a command is enclosed as follows: $(command) or `command`

Bash performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any trailing newlines deleted.

So whatever you type in afterwards is interpreted as part of the command substitution until another backtick is entered.

2
  • Thanks for your prompt reply! Your explanation is clear enough for me to understand, thanks a lot
    – Ray
    Jan 11, 2016 at 14:52
  • I'm a newbie in Ubuntu and this is my first post on askubuntu. I got reply in lightening speed. I really love this Q&A platform.
    – Ray
    Jan 11, 2016 at 14:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .