cp: cannot stat '*': No such file or directory
Not sure what is causing this
I am trying to copy the contents of /etc/skel to a backup directory located in my home directory. Tried as root, same message. Code:
root@darkstar /etc/skel # cp * /home/bjornb/backup/etc-skel/ |
files starting with '.' are not affected by *, so it's like an empty dir, try 'cp .??* /home/bjornb/backup/etc-skel/'
|
Quote:
Works with '.*', what are the question marks for in '.??*' |
a bit of explain: do a 'ls -la', you'll see there are two directories, '.' and '..'; '.' is the current directory, 'cd .' moves you in the directory you already are, while 'cd ..' moves you a level up
'*' is a _wildcard_ that means "any sequence of characters, but it can be empty", if you do 'cp .*', it will try to copy '..' directory too, and this cause problems '?' is a wildcard that means "any single characters, and it must exists"; '.?' is equal to '..' so use two ? to avoid it |
Quote:
* and ? are wildchars (check out this link: http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx) * - means anything could be a single character or a group of characters ? - use to check only a single character For example: Politicians ?UCKs the ? can stand for any character either a letter, number or a symbol. Or whatever your definitions for Politicians. :) |
Quote:
I've never had that happen by specifying 'cp .*'. Without -R specified, I get Code:
cp: omitting directory ‘.’ |
All times are GMT -5. The time now is 05:13 PM. |