LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-04-2005, 07:14 AM   #1
browser
Member
 
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269

Rep: Reputation: 30
How to find file


Could anyone tell me where or how I can find a file called "~/.bash_profile".
I cant find it using any editor. I need to add a "line" to this file apparently . I do know how to add & edit to files like "/etc/rc.conf" so on. But this one doesn't start with /etc or /usr &so on.
I even tried Nano .
AnyWay if a file doesnt start with the usual /etc or /usr /var etc then how can I find it or do I have to create it?
I think I have dealt with this situation before but it was along time ago & I seem to have totally forgotten the procedure.
 
Old 09-04-2005, 07:24 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
The ~ represents your home directory, usually /home/username. So the full path of your .bash_profile file is /home/username/.bash_profile. If the file isn't there, you can create it.
 
Old 09-04-2005, 07:43 AM   #3
browser
Member
 
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269

Original Poster
Rep: Reputation: 30
Great thanks Nylex, looks like I will have to create it.
I appreciate quick reply .
thanks
 
Old 09-04-2005, 11:13 AM   #4
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
The find command is for looking for files.

$ find ./ -name ""ba*" -print

The above searches the current directory as well as all of its sub-directories for files that begin with ba and prints them out.
 
Old 09-05-2005, 03:29 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by Gins
The find command is for looking for files.

$ find ./ -name ""ba*" -print

The above searches the current directory as well as all of its sub-directories for files that begin with ba and prints them out.
One quote too many, and it wouldn't find the file
because your search-term doesn't begin with a "."


Cheers,
Tink
 
Old 09-05-2005, 04:00 PM   #6
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
Thanks Tinkster

It was a mistake.

What would happen if I remove '' ./ '' part?

Last edited by Gins; 09-05-2005 at 04:01 PM.
 
Old 09-05-2005, 04:10 PM   #7
jayemef
Member
 
Registered: Aug 2005
Location: Juniata College, PA
Distribution: Ubuntu, Slackware
Posts: 67

Rep: Reputation: 15
Also please note that your shell will recognize the ~ character. So if you run
Code:
$ cd ~
you will be taken to your home directory, and likewise
Code:
$ gedit ~/.bash_profile
will open the file in gedit.

The period before bash_profile indicates that the file is hidden. So you may (and in fact probably) have the file already. To see, you can simply run the command above to open it. This will appear blank if it doesn't already exist. And to see all the files in your home directory, including hidden ones, run
Code:
$ ls -a ~

Last edited by jayemef; 09-05-2005 at 04:12 PM.
 
Old 09-05-2005, 04:29 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by Gins
Thanks Tinkster

It was a mistake.

What would happen if I remove '' ./ '' part?
Depends on your version of find. The current GNU find
will do exactly the same thing, older ones or ones from
other vendors may spit the dummy, telling you that the
directory needs to come first.


Cheers,
Tink
 
Old 09-06-2005, 05:07 AM   #9
Jongi
Senior Member
 
Registered: Aug 2003
Distribution: Debian Sid 32/64-bit, F10 32/64-bit
Posts: 1,070

Rep: Reputation: 45
there is a locate command in Mandriva LE 2005. Don't know if it works on other distros.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where can I find the file over mounten file system Wallace740 Linux - Newbie 2 03-30-2005 02:46 AM
Linker problem: can't find a file, but the file exists atlep Programming 5 08-16-2004 06:15 AM
Find File broken, need search utility, where does WineX install, KDE file roller? Ohmn Mandriva 6 07-05-2004 10:34 PM
where can I find grammar file and lex file of GNU c ? thinks Huiming Linux - Software 1 06-11-2004 07:38 AM
I can't find the file changlezhang Programming 2 09-04-2003 03:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:24 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