Score:0

Copy directories without files from /etc to other directories

py flag

I want to copy all /etc directories without the files inside of them to other directories. There's another condition that they must start with a, b or c just from the first level.

I tried this:

user@system:/etc$ find . -maxdepth 1 -name "[abc]*" -type d -exec cp {} $HOME/bases2/p01 \;

cp: -r not specified; omitting directory './alternatives'
cp: -r not specified; omitting directory './ca-certificates'
cp: -r not specified; omitting directory './binfmt.d'
cp: -r not specified; omitting directory './apt'
cp: -r not specified; omitting directory './cron.monthly'
cp: -r not specified; omitting directory './chatscripts' 
cp: -r not specified; omitting directory './apm'
cp: -r not specified; omitting directory './cups'
cp: -r not specified; omitting directory './cron.d'
cp: -r not specified; omitting directory './apport'
cp: -r not specified; omitting directory './alsa'
cp: -r not specified; omitting directory './cracklib'
cp: -r not specified; omitting directory './cron.hourly'
cp: -r not specified; omitting directory './cron.daily'
cp: -r not specified; omitting directory './acpi'
cp: -r not specified; omitting directory './cron.weekly'
cp: -r not specified; omitting directory './cupshelpers'
cp: -r not specified; omitting directory './brltty'
cp: -r not specified; omitting directory './avahi'
cp: -r not specified; omitting directory './console-setup'
cp: -r not specified; omitting directory './bluetooth'
cp: -r not specified; omitting directory './bash_completion.d'
cp: -r not specified; omitting directory './chromium.d'
cp: -r not specified; omitting directory './apparmor.d'
cp: -r not specified; omitting directory './apparmor'
cp: -r not specified; omitting directory './calendar'

What does mean "-r not specified"? Which would be the correct way?

I'm new here and I'm learning Linux.

Score:0
ng flag

The error "-r not specified" is given by the cp command. You're pointing it to directories that include sub-directories ("-r" is for "recursive") and it won't copy those unless you tell it explicitly to do so with that switch.

To find empty directories, use:

find . –type d -empty
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.