Ask Your Question
1

is there a way to refresh the terminal without restarting it?

asked 2014-10-22 23:54:20 -0500

mohanprakash gravatar image

updated 2014-10-22 23:55:37 -0500

when we kill a process using kill, the terminal doesn't 'know' the process is killed unless we restart it. Is there any method of refreshing the terminal without restarting it?

edit retag flag offensive close merge delete

Comments

1

Seems to be an interesting question, could please explain a bit more with an example?

anishjp gravatar imageanishjp ( 2014-10-23 07:47:05 -0500 )edit

if I am running the vim editor and I just do a ctrl z and the process stops. Then I kill the process using kill. Before using kill I list the processes by using command ps. I get the pid of vim and kill it using ps pid. After that if I again use the command ps I see the process vim listed. But actually it is killed. The terminal doesn't 'know' it unless it is refreshed. So I exit the terminal, start it again and now I use ps, and the killed process is no longer listed. I wanted to know whether there is any command to refresh the terminal without having to exit it and start it again.

mohanprakash gravatar imagemohanprakash ( 2014-10-27 09:05:26 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-10-23 02:34:09 -0500

anishjp gravatar image

updated 2014-10-28 02:46:42 -0500

I have started the vim. After a while I stopped it using ctrl + z

if I check under jobs

[anishjp@localhost ~]$ jobs
[1]+ Stopped     vim

if i also look under ps

PID    TTY       TIME         CMD
4268  pts/0    00.00.00   bash
4823  pts/0    00.00.00   vim
4840  pts/0    00.00.00   ps

if I issue the command kill -9 %1

[1]+ Killed     vim

if i look under ps again

PID    TTY       TIME         CMD
4268  pts/0    00.00.00   bash
4840  pts/0    00.00.00   ps

Someone can correct me if I am doing it wrong.

edit flag offensive delete link more

Comments

after the kill command, the command ps lists the killed process also. Once we restart the terminal and then the ps command will not list the killed process.

mohanprakash gravatar imagemohanprakash ( 2014-10-27 08:58:29 -0500 )edit
1

@mohanprakash: I have updated my original answer.

anishjp gravatar imageanishjp ( 2014-10-28 02:47:46 -0500 )edit

yes, it works that way. It doesn't if I would use the command:

kill 4823

Please tell me why the terminal lists the process if I kill it this way.

mohanprakash gravatar imagemohanprakash ( 2014-10-30 03:51:30 -0500 )edit
1

answered 2014-10-23 05:27:53 -0500

msuchy gravatar image

Command reset, which re-initalize terminal (just that term, it is really safe, do not confuse it with reboot). Or shortcut Ctrl+L, which just scroll current window, but you can scrool back.

edit flag offensive delete link more

Comments

If "reset" is what you are looking for you might need "tset; reset" practically because only "reset" doesn't help in all situations.

rsc gravatar imagersc ( 2014-10-23 06:13:49 -0500 )edit

tried both tset and reset . still the ps command will list the killed process. One the terminal is restarted, the command ps will not list the killed process.

mohanprakash gravatar imagemohanprakash ( 2014-10-27 09:01:24 -0500 )edit

Wait, what do you mean by "ps will not list the killed process" exactly? Is it possible that you didn't kill the process properly? And what do you mean by refresh? Right now everybody seems to think about refreshing the terminal visually...while you now seem to refer to process management?

rsc gravatar imagersc ( 2014-10-27 16:59:21 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-10-22 23:54:20 -0500

Seen: 8,147 times

Last updated: Oct 28 '14