Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)

Hi, I don't know why I get this error. I have the directory called mock, which inside has another 3 directories. I am trying to copy all the items from the mock directory into the projweek directory using the below code.

cp  /mock/* ~/projweek

But I get the below error

cp: cannot stat ‘mock/*’: No such file or directory

any ideas as to why that is?

1 Answer

0 votes
by (36.8k points)

If your source directory is set in the quotes, then make sure that a * is outside quotes, i.e.

cp "source/"* dest

or

cp "source"/* dest

Come and join Linux training to gain great knowledge. 

 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 29, 2020 in Linux by blackindya (18.4k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...