Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I try to create a list of the files on a CD and to save it as a text file, something must be wrong with my syntax. Entering the command:

gz@gcomputer:/media$ ls -aRl1 >> /home/gz/texte1/infos/DateilisteCD_1.txt

leads to the result:

bash: /home/gz/texte1/infos/DateilisteCD_1.txt: Ist kein Verzeichnis

It means "is not a directory".

I got the paths with the names of the directories from the browser (Nautilus). They all exist.

What is the correct syntax please?

share|improve this question
1  
Does the directory /home/gz/texte1/infos/ exist? –  Nysepho Jun 13 '13 at 17:02
    
@Matthew the error means that something of that name exists but it is not a directory. –  terdon Jun 13 '13 at 17:43

1 Answer 1

This means that you are treating a file as a directory:

$ ls -l
total 4
drwxr-xr-x 2 terdon terdon 4096 Jun 13 19:40 foo       <-- a directory
-rw-r--r-- 1 terdon terdon    0 Jun 13 19:40 foo.txt   <-- a file
$ ls > foo
bash: foo: Is a directory
$ ls > foo/bar  ## WORKS
$ ls > foo.txt/bar
bash: foo.txt/bar: Not a directory

So, one of the names in the path you specify exists but is not a directory. Check that each of /home/gz/texte1/infos/ is actually a directory and not a file.

share|improve this answer
    
They are all existing directories. Only the last item in the list is a text file. As I have written I found the path in the browser. But in the mean time I got an idea what could be the problem. As shown in my listing I am on the main directory of the CD, named media. It is necessary to be there because the directory of the CD should be read. But may be the path of the output is searched also on the CD, where it does not exist of course. How should be the syntax when my path is on the hard disk? –  Zeyer Jun 14 '13 at 16:34
    
@Zeyer The path you are usiing is on the hard disk, not the cd. One of e directories in the oath is probably a file. –  terdon Jun 14 '13 at 16:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.