Computer Science - Unix - Discussion

Discussion Forum : Unix - Section 1 (Q.No. 4)
4.
Which command is used to copy all files having the string chap and any two characters after that to the progs directory?
cp chap?? progs
cp chap* progs
cp chap[12] /progs/*.*
cp chap?? /progs/*
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
11 comments Page 1 of 2.

Bhanu said:   1 decade ago
How do we identify it to be a directory when it is not specified? can't we misinterpret to be a file?

Ramesh said:   1 decade ago
Its not the string in the file. But the name of the file itself.

Lakshmi said:   1 decade ago
Question says progs directory, so doesnt that mean / should be present ?

Please explain answer.

Subhashree Das said:   1 decade ago
If there is directory "progs" then you can not create a file with the same name. When you want to copy multiple files to a single location. Then you can only copy it to a directory, not a file.

Priyanka said:   10 years ago
Hey for copying all files with chap we use * why question mark?

Chet said:   9 years ago
??-> Wha it means?
(1)

Amol said:   9 years ago
@Chet.

?? means any two characters. If you used char* it will show files whose name starting from char like, charcoal, character etc.

Sambit said:   9 years ago
The question asking for progs directory without even mentioning the location of it, then why the answer 'D' is not correct while 'A' is correct. Can anybody elaborate?
(1)

Harryme said:   9 years ago
?? is first two character.

Mahesh said:   9 years ago
It's working correctly when I used char* but when I used char it occurs an error as.

cp: cannot stat 'chap??': No such file or directory.

How to solve this?


Post your comments here:

Your comments will be displayed after verification.