[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: file "[" in /usr/bin???

> From: David Puryear <dayear@market1.com>
> I was doing some house cleaning and found a file named "[" in /usr/bin.
> Does any one have any idea what this is? Is there way to find out which
> package it came from? Here is ls -al:
> LeBox:/usr/bin :-> ls -al [
> -rwxr-xr-x   2 root     root        15633 Mar  9  1996 [ 

Look at the number of links (the part right after "-rwxr-xr-x"). You have
two links to that inode. Now, do an "ls -l /usr/bin/test". Looks identical,

See, in the old days, the Bourne shell could only branch and loop based on
return values of programs. For example:

 	if grep "This is junk" $filename
		rm "$filename"

grep would return a 0 if the string was found (in which case, the "if"
statement would execute the contents of the "then" part). Otherwise, it
would return non-zero. Well, this isn't so good for doing things like
comparing two strings or numbers or testing to see if something's a file or
a directory or whatever. So, someone wrote a program called "test". "test"
would accept an expression and return 0 if the expression was true, and
non-zero if it was false. So, you could now do things like:

	if test $string1 == $string2
		echo "They're the same!"

Now, somewhere along Unix's long and illustrious past, some guy figured
that it would be easier if he could just get rid of the "test" and replace
it with a simpler notation. So, they figured that encapsulating the
expression in square-brackets would be a good idea. To make it so, they
re-wrote test so that it ignores any ending "]" it sees on its command line
and then they linked "[" to "test". So, now you can just say:

	if [ $string == $string2 ]
	then ....

Cute, eh?

> How do I force fsck next time I reboot?

It should be happening anyway. The only difference is that, when you
machine is properly shutdown, Linux will flush all of the disk buffers,
finish up all disk accesses, and then mark the filesystem as "clean". Upon
bootup, fsck will bypass "clean" filesystems because there's no real reason
to suspect them of being corrupted.

> Last time it did, I got 'delete
> inode ####?' or some such. Could some one explain to me what that means.

Looks like you've got an unreferenced inode. It's like having a lost
cluster chain in MS-DOS.

> Is there like defrag or like in linux?

Don't think so. The Unix filesystems are designed to withstand
fragmentation much better than MS-DOS ones do, so you don't really need one
like you do in DOS.

 - Joe

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com

Reply to: