Ls command shows : NOT A DIRECTORY


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Ls command shows : NOT A DIRECTORY
# 1  
Old 05-06-2014
Tools Ls command shows : NOT A DIRECTORY

I am working on ksh shell.
In some folders if i write
Code:
ls *MYFILE* > NEWFILE

then it shows error on few files as
Code:
<filename>/:NOT A DIRECTORY

i have around 9 thousand files in this folder and out of them around 61 are showing error.

However, when i created softlink of that directory and did same there everything went fine...

Whats the problem in executing this command in the original directory???


Moderator's Comments:
Mod Comment Please use code tags next time for your code and data. Thanks

Last edited by vbe; 05-06-2014 at 08:19 AM..
# 2  
Old 05-06-2014
It's a little ambigous as a problem, but I have three possibles as a first stab:-
  • A file that matches your ls *MYFILE* has a space in it. The shell will expand the *MYFILE* to match every file in the filesystem before issuing the ls
  • You have a symbolic link to somewhere that does not exist and your ls in the current directory is trying to follow it, but the ls from a symbolically linked directory does not.
  • A combination of the two?


Does that help at all?



Robin
# 3  
Old 05-06-2014
No it is not combination of any..

suppose file is

SABC_FMYFILE_IS0020_20105060050444.XYZ (its not the original file name as that can't be shared)

i get error:
SABC_FMYFILE_IS0020_20105060050444.XYZ/: Not a directory

instead thousands files with same naming convention are displayed properly.
# 4  
Old 05-06-2014
Um......?
  • Is it the same one every time?
  • Does it happen if you try to list the specific file?
  • What do you see from:-find . -name "*SABC_FMYFILE_IS0020_201005060050444.XYZ*"


I'm a bit stuck....Smilie

Robin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Df -k command shows duplicate information in Solaris machine, How to get the exact disk space

While getting the total disk space in solaris machine using df -k command, i am getting the same disk info for every user available in that system. Is there any way to remove it. Filesystem 1024-blocks Used Available Capacity Mounted on rpool/ROOT/solaris 573898752... (3 Replies)
Discussion started by: prasankn
3 Replies

2. Solaris

Solaris 9 Zone : Date command in crontab shows delayed(One Hour) output

SOLARIS 9 Zone : date command in crontab shows delayed(One Hour) output Hi folks, the date command shows the correct date and time, How ever, if the date command executed through crontab in any form of scrip the output shows as one hour delayed, similar to date -u.. Can some one help in... (12 Replies)
Discussion started by: judi
12 Replies

3. Shell Programming and Scripting

after sed command file shows '????' question marks

Hi All, I am trying to replace a string in a oracle LDT file file extension .ldt. I am using the following command: sed "s/Test Number Viewer/Test Number 1/g" TEST_LIEN_FORM.ldt > TEST_LIEN_FORM.ldt.tmp mv TEST_LIEN_FORM.ldt.tmp TEST_LIEN_FORM.ldt But after the command, the file... (2 Replies)
Discussion started by: veena484
2 Replies

4. Shell Programming and Scripting

How to create a log file that simply shows the name of a file and what directory it was moved to.

Newbie...Thank you for your help. I am creating my first script that simply generates subdirectories to organize video, music, and text files within those subdirectories from my current working directory. PROBLEM: I am trying to write a log file that contains, for each file, the original file... (0 Replies)
Discussion started by: BartleDoo
0 Replies

5. Solaris

svcs command shows the state as disabled

Hi I need to export a directory named /sybase from my solaris machine via NFS. The svcs command shows the state as disabled. Please let me know how to export the directory. Once the directory is exported from the solaris machine it has to be mounted locally in an aix machine. Can some one... (2 Replies)
Discussion started by: newtoaixos
2 Replies

6. UNIX for Dummies Questions & Answers

FTP that works correctly in command prompt and shows issue in UNIX server

Hi All, FTP ports opens with the given user name and password and allows to download file through COMMAND PROMPT. Code as below: H:\>ftp ftpxxxxx Connected to entvc2ft07-pub.xxxxx.com. 220 Microsoft FTP Service User (entvc2ft07-pub.xxxxx.com:(none)): userxxxxx 331 User name okay, need... (1 Reply)
Discussion started by: vijayalakshmi.r
1 Replies

7. AIX

Command that shows mem slots

A while back I had a command that shows the memory slots (and info on the modules inserter) in an IBM AIX machine. I cannot remember it at this time, can someone help me out with this command please? (4 Replies)
Discussion started by: bbbngowc
4 Replies

8. Shell Programming and Scripting

'sed' command shows extra line

Here is an interesting problem that I am seeing when using 'sed'. The goal is to print out the names of the Oracle SID's on a system and here is the command I am using: ps -ef|grep ora|grep pmon|awk '{print $NF}'|sed 's/ora_pmon_//' The output of the command after the awk is this: ... (3 Replies)
Discussion started by: soleil4716
3 Replies

9. UNIX for Dummies Questions & Answers

mt command shows /dev/tape: inappropriate ioctl for device

Hello guys, on my Red Hat machine the /bin/mt status command gives the output dev/tape: inappropriate ioctl for device. This messages comes up after the Server has been rebooted. Anybody an idea? Thx masterofdesaster (8 Replies)
Discussion started by: masterofdesaste
8 Replies

10. UNIX for Advanced & Expert Users

who -9 command shows logged out users

List using 'who -u' command shows logged out user name along with active users. 'kill -9' command fails to kill the user as there no prcess is running. Any solution regarding this problem. (5 Replies)
Discussion started by: utpol_68
5 Replies
Login or Register to Ask a Question