tag:blogger.com,1999:blog-8032022811235182759.post3164505969656513748..comments2024-03-23T08:25:23.254-07:00Comments on Linux Commando: Use of --parents flag in mkdir and cpPeter Leunghttp://www.blogger.com/profile/05589860210899238688noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8032022811235182759.post-39635719389995614212023-03-02T17:14:21.201-08:002023-03-02T17:14:21.201-08:00subscribing (missed doing that in my last comment)...subscribing (missed doing that in my last comment)Charlie Areharthttps://www.blogger.com/profile/07716082427038966807noreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-31545846591930538852023-03-02T17:13:32.080-08:002023-03-02T17:13:32.080-08:00Very helpful, but it may help some readers if we c...Very helpful, but it may help some readers if we clarify that while -p is an abbreviation for --parent in mkdir, it is NOT for cp. I got burned by that mistake (though I don't mean to suggest it's any fault of yours).<br /><br />Instead -p in cp means something else entirely: preserve attributes, which while it may be useful it means that the cp will RUN (and files are COPIED), but the directory structure into which files should have been copied by the --parent arg will NOT be correct. And it could be easy to not notice that it's wrong. Hope that helps someone.Charlie Areharthttps://www.blogger.com/profile/07716082427038966807noreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-52028517451581002052022-10-20T22:03:26.402-07:002022-10-20T22:03:26.402-07:00Hi
Good and very useful information about mkdir c...Hi<br /><br />Good and very useful information about mkdir command. Every option is explanatory and easy to understand.venkathttps://www.linuxtec.conoreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-70198097675051329742019-05-29T06:02:58.931-07:002019-05-29T06:02:58.931-07:00You can simply use the alias -p instead of --paren...You can simply use the alias -p instead of --parents:<br />mkdir -p /../../../<br />cp -p ... ...lyndorhttps://www.blogger.com/profile/08348882167686653674noreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-27652594988371350552017-04-03T07:54:50.775-07:002017-04-03T07:54:50.775-07:00Very helpful. Thank you.Very helpful. Thank you.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-56192762422061780202014-03-25T05:57:18.054-07:002014-03-25T05:57:18.054-07:00--parents option for 'cp' command is usefu...--parents option for 'cp' command is useful, thank you!Anonymoushttps://www.blogger.com/profile/09666802960593625181noreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-70261717711519405982010-11-10T08:43:58.934-08:002010-11-10T08:43:58.934-08:00hello,
is it possible to use the -p option to mak...hello,<br /><br />is it possible to use the -p option to make a parent directory whilst using cp in an shell script<br /><br />when I do cp -p 'files' 'new_directory'<br /><br />I get the error<br /><br />"cp: target 'new_directory' is not a directory"<br /><br />many thanks :-)<br /><br />VictoriaLittle monkeyhttps://www.blogger.com/profile/04359600166223355402noreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-19159817803033902922010-04-20T01:46:54.033-07:002010-04-20T01:46:54.033-07:00Useful! ThanksUseful! ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-30791430828448018692010-02-18T17:42:18.874-08:002010-02-18T17:42:18.874-08:00Nice article man. Very useful to a student of *nix...Nice article man. Very useful to a student of *nix.<br /><br />-ChenngAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-17252944918314202152009-11-27T08:33:36.773-08:002009-11-27T08:33:36.773-08:00The cp command takes a "from-file" and a...The cp command takes a "from-file" and a "to-file". You need to specify a "to-file".<br />cp --parents status/2007/november/nov12.txt somenewfile.txt<br /><br />Please make sure that you can read the example in the original post in its entirety.<br /><br />PeterPeter Leunghttps://www.blogger.com/profile/05589860210899238688noreply@blogger.comtag:blogger.com,1999:blog-8032022811235182759.post-3390061952238177412009-11-27T05:23:23.405-08:002009-11-27T05:23:23.405-08:00There missing something:
cp --parents status/2007...There missing something:<br /><br />cp --parents status/2007/november/nov12.txt<br /><br />-> cp: missing destination file operand after 'status/2007/november/nov12.txt'Anonymousnoreply@blogger.com