Cp Omitting Directory Error Linux
Contents |
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies cp: cannot create directory of this site About Us Learn more about Stack Overflow the company Business
Cp Omitting Directory Centos
Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question cp: cannot overwrite non-directory _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question omitting means Anybody can answer The best answers are voted up and rise to the top What does “omitting directory” mean and how do I make it cp the directory rather than omit it up vote 3 down vote favorite I am doing a data recovery for someone and enter the following command -Ubuntu:~# cp /media/Macintosh\ HD/Users/orlando/Desktop\ (original)/VIDEOS\ ESPANOL/ /media/\$G\$\ DATA/Orlando/Desktop/ And it outputted this, cp:
Cp Cannot Create Directory Permission Denied
omitting directory `/media/Macintosh HD/Users/orlando/Desktop (original)/VIDEOS ESPANOL/' By the way, I am logged in as root. What does this mean and how do I fix it? command-line directory data-recovery cp share|improve this question edited Apr 20 at 4:30 asked Jun 17 '14 at 18:53 Zargold 122128 1 If you doing data recovery you should check out rsync. –dan08 Jun 17 '14 at 19:03 add a comment| 1 Answer 1 active oldest votes up vote 10 down vote accepted The error notice means you told cp to copy files and not directories. The warning is about cp finding a directory and informing you it will be skipped. If you want directories: cp -r means recursive and this option will make cp also include subdirectories. So your command needs to be: cp -r /media/Macintosh\ HD/Users/orlandocampoverde/Desktop\ ... Regarding comment: -u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing share|improve this answer edited Jun 17 '14 at 19:02 answered Jun 17 '14 at 18:56 Rinzwind 139k16268372 Thank you this worked I believe. Is there anyway to make it copy only
'srcdir' $ Solution Add -R option for recursive copy: $ cp -R srcdir destdir See also http://www.rapidtables.com/code/linux/cp/cp-omitting-directory.htm cp overwrite files cp -R command cp command Write how to improve this page CP COMMAND cp omitting directory cp overwrite files cp -R command RAPID TABLES Recommend Site Send Feedback About Home | Web | Math | Electricity | Calculators | Converters © RapidTables.com | About | Terms of Use | Privacy Policy
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more http://stackoverflow.com/questions/15774023/cp-silence-omitting-directory-warning about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up cp: silence “omitting directory” warning up vote 2 down vote favorite 1 I'm using the command cp ./* "backup_$timestamp" in a bash script to backup all files in cannot create directory into a backup folder in a subdirectory. This works fine, but the script keeps outputting warning messages: cp: omitting directory `./backup_1364935268' How do I tell cp to shut up without silencing any other warnings that I might want to know about? bash cp share|improve this question asked Apr 2 '13 at 20:47 Ajedi32 15k45289 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted You can do the following: redirect stderr cannot create directory to stdout using 2>&1 pipe the output to grep -v . cp: omitting directory './backup_1364935268' 2>&1 | grep -v 'omitting directory' quote from grep man page: -v, --invert-match Invert the sense of matching, to select non-matching lines. share|improve this answer edited Apr 3 '13 at 14:23 answered Apr 2 '13 at 20:51 hek2mgl 75.9k885106 Eh, that'll work I guess. I was hoping there'd be some sort of option on cp for silencing warning messages like that but I guess not. –Ajedi32 Apr 2 '13 at 20:55 Do you need am recursive copy of all files and direcotories? Or only the files in the first level of backup_$timestamp ? –hek2mgl Apr 2 '13 at 20:59 Nope, because then every time I made a backup I'd be backing up all the older backups along with other files. Thanks for your help. –Ajedi32 Apr 2 '13 at 23:09 Sorry that was a typo :) I meant: Do you want to copy all files from the first level of the current dir to the backup folder? Maybe there is a solution using find without using grep.. This could speed up things if you have many files. Otherwise grep -v would be my preferred solution –hek2mgl Apr 2 '13 at 23:10 1 Yeah, right now I do want to copy all the files. Perhaps in the