LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-15-2016, 07:11 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
Ctrl+C problems


Quote:
Originally Posted by devnull10 View Post
ctrl+c works fine for me.
Does not work in Slacko 6.3
 
Old 03-15-2016, 08:46 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Run:
Code:
ps aux
That will give you the pid # and the description of the script or program running on the right.
Use the pid # with the kill cmd to stop it.

For example I'm running the gnome shell and the pid for it is:1024. If I wanted to kill it I'd run:
Code:
kill 1024
Wait until the script is done:-
 
Old 03-15-2016, 09:03 PM   #3
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Looking for an automated way to kill it.
 
Old 03-15-2016, 09:20 PM   #4
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by Fixit7 View Post
Looking for an automated way to kill it.

Most modern puppies include pprocess - it should be in the menu under "system" or "utility" or something, or you can start it from a terminal.
http://www.murga-linux.com/puppy/vie...882fe090c72533

Maybe give lxtask a try the Puppy pkg is on the page.
http://puppylinux.org/wikka/LxTask

The lxtask on this page is a bin file.
http://puppylinuxfaq.org/add-on-soft...nager-pet.html
 
Old 03-18-2016, 12:19 AM   #5
rajahindustani
LQ Newbie
 
Registered: Mar 2016
Posts: 10

Rep: Reputation: Disabled
my ctrl c and ctrl z work properly...

Last edited by rajahindustani; 03-18-2016 at 07:24 AM.
 
Old 03-18-2016, 07:43 AM   #6
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Ctrl C terminates a script if it is run from a console, but does not if started from a file manager.

Easiest way is killall [name of script]
 
Old 03-18-2016, 02:26 PM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by chrism01 View Post
I'm trying not to just give you the answer, but
Code:
sleep 1 &
j=1


wait
1 of those lines needs changing, 2 need removing.
If you're sending the whole script into the background (as reqd) the you've got all the time in the world to figure out the correct kill cmd. Its an infinite loop (as reqd).
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
Quote:
Originally Posted by chrism01 View Post
The clue is in the qn

You're just sending the sleep into the the background... Think about the requirement more closely.
@OP you need to pay attention to what chrism01 is telling you. They are correct, you have a "no wait" loop running a do-forever operation, basically, within your for 1-10 loop. I'm betting this makes CTRL-C hard, and I'm also wondering, sans personal experimentation whether or not you have a zillion (give or take) children being spawned with those background sleeps from within your do-forever loop. Why not look at the process list when you run it.
 
Old 03-19-2016, 07:45 AM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
if you are going to be running it in the background off of the command line, which it looks like you already know how to do in post #5.

As you stated this, "My professor needs a demonstration from me and wants to see how i am killing the script. Ctrl^z and Ctrl^c are not working."

the word "demonstration" clearly indicates he just wants to see you preform the task. this is a no brainier if you stop and think about it enough , and requires no coding whatsoever.

it is all command line driven using two terminals and knowing how to use the kill, pkill, or killall command.

All you're really missing is that part where you display "bang", within your code and you are done.

EXCEPT

the next posted question points out something very important too. It is termed overkill, and what are you waiting for seeings how you're already sleeping? Talk about overkill. Figure out that little riddle.

where only one letter in the alphabet is really needed, where then is a true statement needed? another riddle for you.

now go back up and read what @chrism01 had to say and think about it some more, until you get it, then hopefully you'll act on it properly. knowing what the term overkill means too would be important.

Then hopefully you'll get an A+ on this assignment.


(this post has been modified in accordance with some by-law that not even I am aware of)

Last edited by BW-userx; 03-19-2016 at 10:04 AM.
 
Old 03-19-2016, 07:57 AM   #9
cnamejj
Member
 
Registered: Mar 2015
Distribution: Ubuntu
Posts: 37

Rep: Reputation: Disabled
This thread is ancient, revived by accident I suppose. Deleting my comments to avoid tricking others into continuing this.

Last edited by cnamejj; 03-20-2016 at 06:21 AM. Reason: Ancient thread
 
Old 03-20-2016, 04:43 AM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Guys,

can I just point out that the qn & my prev responses are from 2010 ...
 
Old 03-20-2016, 12:56 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
well if he has not figured it out by now then what is to be said of that?
or
I am really getting tired of people pulling old post and reviving them. I don't even get that board.
 
Old 03-20-2016, 01:02 PM   #12
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by BW-userx View Post
well if he has not figured it out by now then what is to be said of that?
or
I am really getting tired of people pulling old post and reviving them. I don't even get that board.
I've bookmarked this post of yours so that I can revive it in 2023.

Me too, but to be fair, I reckon a number of folk who've done that find the threads through Google etc. and don't notice the dates on the thread when they add a post to it.
 
Old 03-20-2016, 01:11 PM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
@hydrurga

haha chuckle chuckle

yeah that is the last thing I look for, when it was first posted. Too much is left to automation.
 
Old 03-20-2016, 06:21 PM   #14
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by chrism01 View Post
Guys,

can I just point out that the qn & my prev responses are from 2010 ...
OK sorry, but ... well LQ does warn us about resurrecting very old threads. So whomever raised the thread up after many years, apparently ignored the warning which comes up before you post. The rest of us are guilty of not noticing that too, but we obviously do not receive warnings by the site once the thread was raised up.
 
Old 03-21-2016, 10:09 AM   #15
LrodMC
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Rep: Reputation: Disabled
In Ubuntu 14.04 LTS, you should be able to do CTRL + ALT + DEL, just like a windows. If you cannot do that, just search "System Monitor" in the start menu. Just look for the process "bash" in the system monitor window, and kill it using the "End process" button. If you can SEE the window and it is frozen, it is easier to go to terminal and type in the following command:
Code:
xkill
OR
Code:
sudo xkill
After entering any of the above commands, just simply click on the window you wish to kill.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
emacs in a terminal : problems with ctrl Willard Linux - Software 5 09-13-2011 04:18 PM
How to disable Ctrl+C, Ctrl+V, Ctrl+X in rdesktop? Aswathy Linux - Newbie 1 01-19-2011 06:22 PM
[SOLVED] vim:ctrl+v command to select some data.But when I push ctrl+v.It doesn't work.. e3399 Linux - Newbie 20 12-07-2010 06:21 AM
Recognizing ctrl+c,ctrl+l,ctrl+d in C programs leonardo6023 Programming 1 08-19-2009 09:23 AM
Any way to create bash short cuts (like CTRL+l for clear and Ctrl+D for exit) supersubu123 Linux - General 5 05-30-2007 03:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration