LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-19-2003, 09:54 AM   #1
costasm
Member
 
Registered: Dec 2002
Posts: 71

Rep: Reputation: 15
Meaning of .files and when to use ./filename


This may have been asked before but I dont even know how to search the forum for this question

Its really two questions.

1) What does it mean when a filename (or directory name?) is starts with a . (dot). Are these supposed to be hidden files?
E.g. .myFile will not be shown by "ls" but only "ls -a"

2) Why do I see many times references to filenames in commands preceded by the ./ instead of just the filename in the current directory E.g:

#cat ./someFile instead of #cat someFile

I am guessing so its to force to use the file from the current directory to avoide searching environment paths.
P.S. I know the meaning of . and ..

If there is a link somewhere where these things are discussed I would appreciated.
 
Old 10-19-2003, 10:05 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
1) Yes it is used to hide files - like the hidden file attreibute in windows.
2) With cat there should be no need to use "./" This should really only be used for running executeables in hte current directory. When you cat a file it won;t look in your path.
 
Old 10-19-2003, 10:19 AM   #3
costasm
Member
 
Registered: Dec 2002
Posts: 71

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by david_ross
1) Yes it is used to hide files - like the hidden file attreibute in windows.

I find it weird that such a convention exists. I would think that a hidden file would be an attribute of the file properties and not of the filename itself. It sounds weird to have to change the filename if you want to unhide it. What if your app is referring to .filename and then someone renames it?

2) With cat there should be no need to use "./" This should really only be used for running executeables in hte current directory. When you cat a file it won;t look in your path.
Ok, why wouldn't the shell search the current directory first for the executable?

Is there some tutorial I can read on this stuff? WHat would I search under.
 
Old 10-19-2003, 10:23 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
The bash will only search the directoies in the path variable - to see your paths:
echo $PATH|sed s/\:/\\n/g

The bash howto probably has most of this in it:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
 
  


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
for script: listing files which have space in filename hamish Linux - General 5 10-22-2005 10:25 AM
change uploaded files from filename.avi to filename.avi.html like www.rapidshare.de latheesan Linux - Newbie 3 06-16-2005 05:33 AM
filename.part << partially downloaded files... jimjamjahaa Linux - Newbie 2 04-04-2005 12:48 PM
filename- and filename~ files? slinky2004 Linux - Newbie 5 10-17-2004 11:32 PM
Amazing thing !I could not remove files even i am root and rm -fr filename. whepin Linux - General 6 01-04-2002 07:30 AM


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