Remember that a directory is basicly a table with each entry being a name and an inode. In the usual case of a mysteriously undeletable file the name is some very difficult-to-type string of characters. So we suggest some counter-measure that avoids needing to type the name, such as
cd /directory
rm -i *
There is nothing actually wrong in these cases, we just have a very odd filename.
But notice this:
No odd filename can yield this result. Because the OP succeeded in cd'ing to this directory, he should also have permission to stat(2) the files. A simple "ls -l" should bypass the name problem just a a simple "rm -i *" would. But stat(2) appears to be failing. My guess is that the inode numbers are pointing to unallocated inodes.
In theory, "fsck -f" should fix this, and that is what I would recommend as a start. However, I have not yet encountered this problem in Linux, so I have never tried this myself.
I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler
#!/bin/ksh
VAR='Oranges'
if
then
echo "Found Lemons"
elif
then
echo "Found Oranges"
fi
The output shouold clearly be "Found Oranges", but... (2 Replies)
I have a few files on my system named:
-rw-------
-rw-r-----
-rw-rw--w-
-rwxrw-r-x
(Yes, it's really the name of the file, not the access permissions, they're 0 bytes large and all created at the same date/time).
I've no idea how they got there but I don't seem to be able to delete them... (2 Replies)
Hi,
How do I delete a file name that starts with a hypen?
e.g. -unix_file_2006_10_3
I always get an erroe when I use rm command. I am using Solaris.
Thanks,
Hi,
One of the Unix books I read to remove this weird file suggest to use:
"rm ./-unix_file_2006_10_3"
which I did today and file... (3 Replies)
Greetings To All!
I am running Solaris 10 in a sparc environment.
Here is the deal:
In /var/spool/cron/crontabs, there is a cron user named "sys". If I do a
crontab -l sys, it returns:
# 0 * * * 0-6 /usr/lib/sa/sa1
# 20,40 8-17 * * 1-5 /usr/lib/sa/sa1
# 5 18 * * 1-5 /usr/lib/sa/sa2... (8 Replies)
Guys, I have two files in a directory with weird permissions, size, owner, date etc... the problem is I canīt delete them! I tried to chmod the files and everything, but nothing seems to work. Anyone got any ideas ???
Look:
# ls -l
total 1327968579
?--------- 48 1645863428 2150720025... (1 Reply)
Hi,
I want to install net-snmp-devel package but i have following dependecy problem.
It's very odd, i don't get it. One of packages is depended on the other one, the other one is depended on the previous one as well. :S :S
Could you help me please?
Here are the steps:
# ls -l
total... (4 Replies)
Hi all,
Sorry for the title because I didn't find a proper name for it. My question is about POSIX functions, such as timer_create(), mq_open() and pthread_create().
void test_queue()
{
struct mq_attr attr;
attr.mq_maxmsg = 10;
attr.mq_msgsize = 64;
mq_unlink("/my_test_queue");... (6 Replies)
Hi,
I created some files with a script and I don't know yet where I did a mistake but the script created some "weird" files...
prd01,/tmp # ls -al
total 706184
-rw-r----- 1 root system 34 Aug 27 16:10
hdisk3BB
hdisk3
hdisk3BB.tmp
drwxrwxrwt 51 bin bin ... (9 Replies)
Hi,
I have a simple awk script:
BEGIN{}
{
$a=$2-$1;
print $a
}
END{if(NR==0){
print "0"
}
}
to which I provide the following input
2.9 14
22.2 27 (4 Replies)
Discussion started by: jamie_123
4 Replies
LEARN ABOUT PLAN9
clri
clri(1M) System Administration Commands clri(1M)NAME
clri, dcopy - clear inode
SYNOPSIS
clri [-F FSType] [-V] special i-number
dcopy [-F FSType] [-V] special i-number
DESCRIPTION
clri writes zeros on the inodes with the decimal i-number on the file system stored on special. After clri, any blocks in the affected
file show up as missing in an fsck(1M) of special.
Read and write permission is required on the specified file system device. The inode becomes allocatable.
The primary purpose of this routine is to remove a file that for some reason appears in no directory. If it is used to zap an inode that
does appear in a directory, care should be taken to track down the entry and remove it. Otherwise, when the inode is reallocated to some
new file, the old entry will still point to that file. At that point, removing the old entry will destroy the new file. The new entry will
again point to an unallocated inode, so the whole cycle is likely to be repeated again and again.
dcopy is a symbolic link to clri.
OPTIONS -F FSType Specify the FSType on which to operate.
The FSType should either be specified here or be determinable from /etc/vfstab by matching special with an entry in the
table, or by consulting /etc/default/fs.
-V Echo the complete command line, but do not execute the command. The command line is generated by using the options and
arguments provided by the user and adding to them information derived from /etc/vfstab. This option should be used to ver-
ify and validate the command line.
USAGE
See largefile(5) for the description of the behavior of clri and dcopy when encountering files greater than or equal to 2 Gbyte ( 2 **31
bytes).
FILES
/etc/default/fs Default local file system type
/etc/vfstab List of default parameters for each file system
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO fsck(1M), vfstab(4), attributes(5), largefile(5)NOTES
This command might not be supported for all FSTypes.
SunOS 5.10 16 Sep 1996 clri(1M)