Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-21-2009, 12:50 AM   #1
sumeet inani
Registered: Oct 2008
Posts: 905
Blog Entries: 26

Rep: Reputation: 49
how to abort command

Suppose I gave following command to find jpg files in windows folder
find /windows -iname *.jpg
A long list will start scrolling then how to terminate command (like ctrl+break in DOS).Simply closing terminal window is not correct way.
Old 04-21-2009, 12:59 AM   #2
Registered: Jun 2007
Posts: 118

Rep: Reputation: 17

Use CTRL+C for halting that and CTRL+Z for running that in background

Old 04-21-2009, 01:23 AM   #3
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Fedora, Centos
Posts: 298

Rep: Reputation: 65
Originally Posted by greplinux View Post

Use CTRL+C for halting that and CTRL+Z for running that in background

To clear the last point up a bit:-

CTRL+Z will stop the program. You can then either type bg for background or fg for foreground. Give it a try it won't break anything.
Old 04-21-2009, 05:38 AM   #4
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
Or lets say you want to start a program from a terminal window but would like to continue working from that same terminal. Start the program and postfix the command with a & the ampherstand will start the program in the back ground and return you to the prompt. i.e. emacs & will start emacs then return you to the prompt.
Any time you open a terminal that terminal becomes the parent process and anything you start within becomes a child process so to keep using the same terminal for other things you must run the child processes in the background or wait until they are done. Also it should be noted, if you have several child processes running in the background and you kill the parent process you will kill all the child processes also.
Old 04-23-2009, 12:54 AM   #5
sumeet inani
Registered: Oct 2008
Posts: 905

Original Poster
Blog Entries: 26

Rep: Reputation: 49
I ran
find /windows/ -iname *.exe
then list started scrolling then I pressed ctrl+z then entered bg so list continued & before I can write another command the list overwrites it so it is horrible when command's output is continuous because you have to wait till it finishes like in fg.
Any comments.
Old 04-23-2009, 01:00 AM   #6
Senior Member
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
Take a look a man more and man less. Either can be used to limit output to one page at a time.
Old 04-23-2009, 01:02 AM   #7
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Not sure how much use find is if you can't see the output.

You could use

find /windows/ -iname *.exe > output.txt

to write the output to a file called output.txt

If you still find that locks things up for too long, try

find /windows/ -iname *.exe > output.txt &

where the & forces the command to run in the background. It still writes the output to output.txt
Old 04-26-2009, 08:39 AM   #8
sumeet inani
Registered: Oct 2008
Posts: 905

Original Poster
Blog Entries: 26

Rep: Reputation: 49
(1)as billymayday told you can send search output to file if there are more than screenful of results also send searching to background by adding ' &' after command & run other commands in same terminal.
(2)As lazlow said you can run
<command> | more
to see 50 result at a time &
<command> | less
to scroll the list one by one with arrow keys.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SSH abort during login jack_cn Linux - Server 2 01-16-2008 12:00 PM
I abort scp, how do I clean up? brian_p_sully Linux - General 1 01-03-2008 03:25 PM
SCSI ABORT operation problem halturata Linux - Hardware 1 09-04-2007 02:46 AM
apt-get >> abort problem Coldfish Debian 1 09-23-2005 09:42 AM
Adaptec aic7xxx ABORT -- need help!!! geos Linux - Hardware 1 07-15-2003 08:26 PM > Forums > Linux Forums > Linux - Newbie

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

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