Tag Info

New answers tagged

3

The problem is you're moving a file onto a directory. This is allowed to fail. I'm going to tell you how it once was. mkdir used to essentially read this (while I'm writing this in sh, it was really written in C and setuid-root). mknod d $1 ln -d $1 $1/. ln -d `dirname $1` $1/.. So as you can see there's not much special about . and .. except for the ...


16

.. is not special, it is just that it already exists. On Unix, Dos and MS-Windows every directory has a directory . it links back to itself, and a directory .. it links to its parent directory (or self if root directory). If .. and . are special it is only because you can not remove them (actually you can, you just remove the directory that contains ...


45

You can't rename a file to . or .. because all directories already contain entries for those two names. (Those entries point to directories, and you can't rename a file to a directory.) mv detects the case where the destination is an existing directory, and interprets it as a request to move the file into that directory (using its current name). ...


0

lrwxr-xr-x 1 jsw staff 6 1 Aug 13:54 /Users/jsw/.vimrc -> .vimrc You've made a mistake; this was produced by the equivalent of: ln -s .vimrc .vimrc You could have done something more convoluted than that (ln -s foo/../.vimrc .vimrc), but in any case, as long as there isn't an actual .vimrc file, ln will create the link, but it will be a dud. ...


2

/etc/skel contains files to be copied to new user's home directories, therefore the names are, of course, the same as in an user's home directory. This explains /etc/skel/.bash_profile. The directory /root also is a home directory, namely the home directory of the user root. This explains /root/.ssh and /root/.config. /etc/.pwd.lock seems to be a lock file. ...


2

This might be a highly opiniated answer, but I think the main reason dot files and dot directories are marked like that is not to hide or obscure them - I think it's just to let the user know that within those files and directories are program's and user's settings that can be changed by them or by the programs themselves. The fact that dot files and dot ...


11

You've misinterpreted the primary rationale for "hidden files". It is not to prevent users from messing around with things. Although it may have this consequence for very new users until they learn what a "dot file" is (dot file and dot directory are perhaps more appropriate and specific terms than "hidden"). All by itself it doesn't prevent you from ...



Top 50 recent answers are included