i am using solaris 5.10. i can create two different files "test" and ".test" in the same directory. now suppose i want to change the attribute of the hidden file .test to visible is it possible???
since "." is just an attribute to mark a file hidden why is unix allows creation of "file" and ".file" in the same directory
I dont think its an attribute ... but i might be wrong, file and .file are two different file really, the leading dot is part of the filename but interpreted so to hide the file with "normal ls'ting"
thats exactly my question. if leading "." is interpreted has making the file hidden, why does unix allows to creating a "file" when ".file" is present.
conversely if suppose i have "file" and ".file" in my directory isnt there any way i can make ".file" visible without changing either of the file names
sure there is, just type 'ls -a' you'll list both file and .file.
And you can access both files with same way with no special requirement for the dotted one ...
itz not abt "why i would want to do that", its about "why does it happen"... ever since i have started working on unix, i have been fascinated by itss simplicity and consistency... itz so unUNIX like, not allowing to do something that could be done......
anyways thanks for ur help
Its not about "why I would want to do that", its about "why does it happen"... Ever since I have started working on unix, I have been fascinated by its simplicity and consistency. Its so un-unix-like, not allowing to do something that could be done. Anyway, thanks for your help.
1) to make the file visible. Please remove the . from the file name.
2) when you remove . the file name turns to file.
3) but there is already a file with the name "file".
4) So you have to rename the .file to some other name.
I Hope there is no other soln. than renaming.
Because Unix directory does not supports 2 files with same name
so you can append a symbol like % infront of .file like %file
or you can rename to another file.
to make it visible.
Exactly! test and .test are totally different filenames. They have nothing to do with each other except that they are in the same filesystem and in the same directory.
bash-3.00# cd /tmp
bash-3.00# touch test .test
bash-3.00# ls -lid test .test
37946100 -rw-r--r-- 1 root other 0 Dec 28 03:41 .test
36778413 -rw-r--r-- 1 root other 0 Dec 28 03:41 test
As you can see, the inode numbers are different, making these different files, not representations of the same file.
then doesnt it sound like an error in UNIX system. that we actually have to change file names to make them visible.
like suppose one installed program reads from the file /home/vik/impdata
then one day i find that i have confidential data in impdata and want to make it hidden. in that case. in that case that program too will stop working as the file name has changed.
some of you might think am dragging this issue a little too further but i really believe that this is not the correct way( rename) to make a file hidden