LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   don't put filename in quotes when using wildcards (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/dont-put-filename-in-quotes-when-using-wildcards-877961/)

newbiesforever 04-30-2011 01:26 AM

don't put filename in quotes when using wildcards
 
When I use cp to back up files, I couldn't use a wildcard until now. I just figured out I was making a syntax error. I had entered:
Quote:

cp -urv '/mnt/sda3/folder/folder/*.*' '/mnt/sdb2'
It worked only once I thought to remove the quotation marks--evidently, quotation marks prevent Linux from recognizing a wildcard. The correct syntax is:
Quote:

cp -urv /mnt/sda3/folder/*.* '/mnt/sdb2'
Is this an unnecessary thread? I don't know: any advanced user undoubtedly knows the above and will think "duh," but I supposed it might help a novice user.

onebuck 04-30-2011 07:51 AM

Hi,

Learn the syntax for a command. 'man command' is the place to get the basics. Sure it will seem cryptic at first but continued use will be fruitful.

Quote:

Just figured out a Linux problem that has been stumping you for months?
Fits, so I'll let your post stand within.

Just a few links to aid you to gaining some understanding;



1 Linux Documentation Project
2 Rute Tutorial & Exposition
3 Linux Command Guide
4 Bash Beginners Guide
5 Bash Reference Manual
6 Advanced Bash-Scripting Guide
7 Linux Newbie Admin Guide
8 LinuxSelfHelp
9 Utimate Linux Newbie Guide
10 Linux Home Networking
11 Virtualiation- Top 10

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!

:hattip:


All times are GMT -5. The time now is 09:08 AM.