Lingua Africa task 9/10

Hello all,

I am stucked in my command line in the project Ligua Franca task 9 and 10
https://www.codecademy.com/courses/learn-the-command-line/articles/command-line-offline-project

In my command line I am supposed to use a wildcard * : (please not that the format in this forum changes bold letters into ** ** which makes it diffuclt to read given the fact we use *, adding a screenshot for better understanding

"A directory called todocontains subdirectories of continents with language files in them. List the contents of the directory, todo/* . (

Task 10

Please copy these files to their appropriate locations under the current top-level directory.
All the files under todo/africa/ should be copied to africa . Use the * character as a wildcard to select all files in a directory when you copy them."

when I use the

cp todo/africa/* africa
cp todo/europe/* europe
cp todo/asia/* asia

in my terminal on mac os it tells me :
cp: todo/africa/: No such file or directory

cp: africa is a directory (not copied).

cp: asia is a directory (not copied).

cp: europe is a directory (not copied).

I am not sure what to here, i can’t figure out if it’s a format problem, even if I am using this one which appears in the solutions file.
Also I have a question regarding wildcards, in the class on codecademy i was using " cp * directory/" which is supposed to copy all files of the directory and in this case solutions shows the other way “cp directory/directory/ *” (spa ce or no space between * and / ? )

Thank you in advance for any help,

Cyrille

Regarding your question about using cp, the syntax you’re using is basically copy source destination. If you used cp * destination/ then you’d be copying multiple items from the current directory into the destination folder cp source source source source destination/ which is fine (cp accepts multiple sources to copy).

Your source could equally be the contents of a directory cp directory/directory/* destination/. They could both be directories, it’s just a path for source or destination.

Thanks for linking the project here, it helps. The wildcard effectively expands out any matches as multiple arguments. So cp todo/asia/* destination/ would be the same command as cp todo/asia/bengali.txt todo/asia/punjabi.txt destination/.

You could double-check the items being copied this way with ls which should then provide both those items. To compare the two accurately you must use the wildcard with the argument for ls here too, not just the directory name-

ls todo/asia/*
Output: todo/asia/bengali.txt  todo/asia/punjabi.txt

Hopefully that helps a little, if only with background. I’m not sure why you’re having the issue “No such file or directory” warnings though. It seems a bit like the wildcard is not being interpreted normally.

Whilst there are routes to change the wildcard behaviour they wouldn’t be used by default so far as I’m aware. For a little debugging what is the output you get for ls *. If typing it out doesn’t work consider a screenshot.

Thank you very much for the quick reply and clarification on the use of the wildcard ! :slight_smile:
So to give you more about my terminal ;
when i type ls *
africa:

afrihili.txt

asia:

bengali.txt punjabi.txt

europe:

yiddish.txt

when i type ls todo/*
zsh: no matches found: todo/*
when i type ls todo/ * (with a space in this case)
ls: todo/: No such file or directory

africa:

afrihili.txt

asia:

bengali.txt punjabi.txt

europe:

yiddish.txt

it seems there is an issue with the wildcard caracter or something ? it it possible that my Azerty keyboard doesn’t have the “right” * ?

1 Like

Is it possible you are in the todo directory? Make sure you’re starting in the expected directory, pwd would help. Use cd to navigate back to original unpacked lingua-franca folder.

I think I followed the previous instructions correctly but if not it may not be exactly the same as yours. Anyway the contents I observe with ls * are as follows -

africa:
afrikaans.txt

asia:
arabic.txt  hebrew.txt  hindi.txt  japanese.txt  korean.txt  malay.txt

europe:
chinese.txt  french.txt  italian.txt     russian.txt
english.txt  german.txt  portuguese.txt  spanish.txt

northamerica:
english.txt  french.txt  spanish.txt

southamerica:
portuguese.txt  spanish.txt

todo:
africa  asia  europe

world:
esperanto.txt

oh lord :roll_eyes: that was me you are right , i was in the todo already

thanks again, it works now :slight_smile:

Understandable, navigating with the command line is a right pain when you’re still getting used to it. In a lot of circumstances I actually prefer it these days but that took me a while to get used to. If you want a bit of a GUI without leaving the command line tools like ranger and nnn are fantastic (though that’s by no means an exhaustive list of similar options).