LinuxQuestions.org
Visit Jeremy's Blog.
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 06-26-2006, 09:04 AM   #1
esm03
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Rep: Reputation: 0
Search commands


Hey all I need your help. Can someone please tell me how I can search for a file containing the file name db2.. I want to do a file search in terminal..

also once I find the file How can I check what processes are running in the background, once I see that how do I stop the processes.


I appreciate the help guys.
 
Old 06-26-2006, 09:12 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Quote:
Originally Posted by esm03
Hey all I need your help. Can someone please tell me how I can search for a file containing the file name db2.. I want to do a file search in terminal..

also once I find the file How can I check what processes are running in the background, once I see that how do I stop the processes.


I appreciate the help guys.
Hi!

Use the command "find" to search for files in a terminal:

Code:
find /home/esm03 -name 'db2'
The above will search for the file name 'db2' only inside your home. If you use "/" instead of "/home/esmo03", it will search all the way from the root directory. Depending of your PC speed and amount of files, this can take a while ^_^. To list your processes running in the background, use the ps command:


Code:
ps -ef
There are many flags to use with both commands. "man find" and "man ps" will give you a complete list.

Regards!

Last edited by Mega Man X; 06-26-2006 at 09:13 AM.
 
Old 06-26-2006, 09:21 AM   #3
esm03
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Im having a problem, I cant figure out what you mean by home/esm03


that doesnt appear to be my directory
 
Old 06-26-2006, 09:23 AM   #4
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
it's /home/<Whatever_your_username_is>

so you can substitute that for your users name, it al ldepends on where you think it is, obviously searching home will be quicker than your / but if you're not sure then it's better to try

Code:
find / -name 'db2'
 
Old 06-26-2006, 09:24 AM   #5
esm03
LQ Newbie
 
Registered: Jun 2006
Posts: 6

Original Poster
Rep: Reputation: 0
how can i find my home directory????I am under root right now as user name

Last edited by esm03; 06-26-2006 at 09:52 AM.
 
Old 06-26-2006, 10:16 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Root's home directory is /root. You really should make a normal user account so you don't always have to use the root account (it's dangerous!).
 
Old 06-26-2006, 10:17 AM   #7
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
your home directory is /home/<username>
So if you login to linux with the usename "bob" then it would be /home/bob
You can go to /home to see what directorys there are and see.
Code:
cd /home
ls
 
Old 06-27-2006, 01:09 AM   #8
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
If you want to know what you current user home directory is, open a terminal and type:

Code:
cd
pwd
As suggested above, don't use the root account. Unlike administrator account in Windows, root in Linux have a point ^_^;;
 
Old 06-27-2006, 02:04 AM   #9
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Quote:
Can someone please tell me how I can search for a file containing the file name db2.. I want to do a file search in terminal..

also once I find the file How can I check what processes are running in the background, once I see that how do I stop the processes.
For searches you can also do the following:

locate -u &
(updates file database)

after about 2 minutes type:

locate -r 'db2'

To list all processes running on your server type:

ps -A
or
ps -aux

to kill a process type:

kill -15 <PID> or kill -9 <PID>

<PID> - process ID is the number corresponding to the process you want to stop from the 'ps -A' or 'ps -aux' listing.

You can also use:

kill -15 `pidof <processname>` or kill -9 `pidof <processname>`
to stop processes by using their names instead of PID.
 
  


Reply


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
Suse Linux Commands For These Aix Commands? Vaskar Guha Linux - Software 2 12-19-2005 12:45 AM
search default: search post title only slackie1000 LQ Suggestions & Feedback 4 03-10-2005 07:50 AM
simple search commands in linux t3___ Linux - Newbie 6 06-08-2004 01:16 PM
Quick VIM question (unhighlighting search terms after search) lrt2003 Linux - Newbie 5 05-08-2004 05:21 PM
basic linux commands... search? Mytherall Linux - Newbie 1 02-23-2004 06:52 AM

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

All times are GMT -5. The time now is 11:27 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration