Hi all,
So I have found a file literally called "-X" in a folder, that is preventing me from using any meaningful commands in that folder because, as I understand it, at command runtime it will convert any wildcard characters into matching filenames, thus a command such as:
ls *
Ends up actually doing:
ls -X
Because the -X file is the first one in the folder...which is not a valid argument for ls. And thats what SunOS tells me. This happens with every command I've tried so far. The nature of this problem has also made it difficult for me to google for answers, so I'm hoping someone here can help me with an explanation or a way to rename this file! Here's some examples of my troubles:
root@qmgt2 # ls -al
total 3695918
-rw-r----- 1 root other 1771857920 Nov 14 2006 -X
dr-xr-xr-x 22 bin bin 512 Mar 29 2010 .
drwxr-xr-x 48 root root 2048 Feb 24 12:41 ..
drwxr-x--- 2 root other 512 Mar 9 2005 APP_BACKUPS
drwxr-xr-x 6 root other 512 Sep 22 2004 ORCLfmap
dr-xr-xr-x 37 bin bin 1024 Mar 29 2010 OV
drwxr-xr-x 3 root bin 512 Sep 20 2004 SUNWits
drwxr-xr-x 5 root sys 512 Sep 20 2004 SUNWrtvc
drwxr-xr-x 3 root other 512 Sep 24 2004 VRTSvcs
drwxr-xr-x 3 netcool ncoadmin 512 May 26 2009 alu
drwxr-x--- 3 root other 512 Apr 4 2005 backups
drwxrwxrwx 2 root other 512 Sep 22 2004 bin
drwxr-x--- 3 root other 512 Mar 29 2010 cfgdwn
drwxr-xr-x 5 root sys 512 Jun 12 2008 dcelocal
-rw-r----- 1 root other 25 Nov 15 2006 exclude
-rw-r----- 1 root other 1243 Nov 14 2006 exclude.txt.new
-rw-r----- 1 root other 2809 Nov 15 2006 exclude.txt.old
drwx------ 2 root root 8192 Sep 20 2004 lost+found
drwxr-x--- 3 root other 512 Feb 23 2005 mnams
-rw-r----- 1 root other 39992320 Sep 17 2007 mnams.tar
drwxr-x--- 3 root other 512 Mar 2 2005 msg
drwxr-xr-x 4 root other 512 Nov 10 2009 netcool
-rw-r----- 1 root other 79429147 May 28 2007 netcool.tar.gz
drwxr-xr-x 12 netcool ncoadmin 512 May 26 2009 netcoolnsa
drwxr-x--- 2 root other 512 Sep 7 2005 oracle
dr-xr-xr-x 12 bin bin 512 Jun 12 2008 perf
drwxr-xr-x 3 root bin 512 May 27 2005 sfw
drwxr-x--- 2 root other 28672 Apr 4 2010 tmp
root@qmgt2 # ls *
ls: illegal option -- X
usage: ls -1RaAdCxmnlhogrtucpFbqisfL@ [files]
root@qmgt2 # du -sk * | sort -n
du: illegal option -- X
usage: du [-a] [-d] [-h|-k] [-r] [-o|-s] [-L] [file ...]
root@qmgt2 # tail -X
usage: tail [+/-[n][lbc][f]] [file]
tail [+/-[n][l][r|f]] [file]
root@qmgt2 # tail "-X"
usage: tail [+/-[n][lbc][f]] [file]
tail [+/-[n][l][r|f]] [file]
root@qmgt2 # mv -X new.dat
mv: illegal option -- X
mv: Insufficient arguments (1)
Usage: mv [-f] [-i] f1 f2
mv [-f] [-i] f1 ... fn d1
mv [-f] [-i] d1 d2
root@qmgt2 # mv "-X" new.dat
mv: illegal option -- X
mv: Insufficient arguments (1)
Usage: mv [-f] [-i] f1 f2
mv [-f] [-i] f1 ... fn d1
mv [-f] [-i] d1 d2
root@qmgt2 # mv '-X' new.dat
mv: illegal option -- X
mv: Insufficient arguments (1)
Usage: mv [-f] [-i] f1 f2
mv [-f] [-i] f1 ... fn d1
mv [-f] [-i] d1 d2
root@qmgt2 # mv *X new.dat
mv: illegal option -- X
mv: Insufficient arguments (1)
Usage: mv [-f] [-i] f1 f2
mv [-f] [-i] f1 ... fn d1
mv [-f] [-i] d1 d2
I've never encountered this before. Something tells me that there is something special about this -X "file"... besides it being a royal PITA.