LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to stop a command or start over, in a terminal (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-stop-a-command-or-start-over-in-a-terminal-472784/)

royeo 08-10-2006 08:06 PM

How to stop a command or start over, in a terminal
 
I asked how to start over in a terminal before and I got an answer and it works but... The command I use now is "Ctrl + \" and like I said it works but after the command stops and I'm back at the prompt anything I enter, type, whatever, after that makes no sign. If I type in cd /. . . it's invisible.

Does anybody know how to start over in a terminal and then be able to see what you type.

I have FC-5 and use KDE.

Thanks,

royeo

brainiac 08-10-2006 08:09 PM

I use "Ctl"-c to stop a command and then an up arrow to reshow the previous command.

pablob 08-11-2006 01:20 PM

sometimes " # tput clear " and " # reset " works if you can't see anything you are writing.

jstephens84 08-11-2006 03:41 PM

if you type history it will give you a list of commands that you have typed.

osor 08-11-2006 04:53 PM

In addition to what's mentioned above, you can use smart job control features of your shell to make life eaiser for you. To do job control for bash, you can: use Ctrl-Z for stopping/pausing the foreground process, type `bg' to run a stopped process (but run it in the background), or type `fg' to run a stopped process in the foreground. The command `jobs' will give you a list of jobs and their numbers. If you have many jobs, you can use the aforementioned numbers after `fg' and `bg' to indicate what job you are applying the command to.

jstephens84 08-11-2006 05:00 PM

Also to start a job in the background you could type the command and place a ampersand after it IE ls -al & would run this job in the background

soggycornflake 08-12-2006 01:21 PM

Quote:

The command I use now is "Ctrl + \"
Ctrl+\ sends a SIGQUIT to the process, which kills it (and if it's changed the terminal parameters, then your screen will be bodged).

It's generally better to use ctrl+c (SIGINT) to cause a clean exit, you'd usually only use ctrl+\ when ctrl+c doesn't work (and after that, do a reset if necessary as pablob mentioned).

Also note that ctrl+\, ctrl+c etc are just the default keys for these purposes, you can change them with stty (stty -a will show you the current terminal settings).


All times are GMT -5. The time now is 09:36 AM.