cp /from /to change in 3.2?

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

cp /from /to change in 3.2?

Post#1 by Ed_P » 15 Jul 2016, 17:55

Porteus 3.2 rc4 Cinnamon

I'm trying to make a copy of my /home/guest files. In 3.0 I use:

Code: Select all

cp  -v    /home/guest/*                            $GUEST/
which results in just the files in the /home/guest/ directory being copied.

In 3.2 when I use a similar command I get everything in /home/guest/ including all subdirectories and all hidden subdirectories!! I've tried home/guest/ and /home/guest/*.* with the same inclusive results. I've done a cp --help and reviewed the options but don't see anything that omits subdirectories.

I'm not sure this is a 3.2 bug or simply my lack of knowledge.

Any ideas?
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: cp /from /to change in 3.2?

Post#2 by Bogomips » 15 Jul 2016, 18:18

Have not met this problem, but for what it;s worth there are two options
  • Code: Select all

    zip $GUEST/guest,zip /home/guest/*
    cd $GUEST; unzip guest.zip
    Works when zipping /var/log :)
  • Or Bash

    Code: Select all

    for f in /home/guest/*; do [[ -f $f ]] && cp  -p  $f $GUEST; done
Preserving timestamp. :wink:
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: cp /from /to change in 3.2?

Post#3 by Ed_P » 15 Jul 2016, 19:43

Thanks Bogomips. I tried the 2nd option and still got all the subdirectories.
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: cp /from /to change in 3.2?

Post#4 by Bogomips » 15 Jul 2016, 20:00

  • rc4 Cinnamon

    Code: Select all

    guest@porteus:~$ uname -r; uname -m
    4.6.3-porteus
    x86_64
    
  • Code: Select all

    guest@porteus:~$ ls -l /tmp/gst/
    total 0
    guest@porteus:~$ for f in /var/log/*; do [[ -f $f ]] && sudo cp  -p  $f /tmp/gst/; done
    
    guest@porteus:~$ ls -l /tmp/gst/
    total 232
    -rw-r--r-- 1 root root 16571 Jul 15 18:15 Xorg.0.log
    -rw------- 1 root root     0 Jul  1 03:29 btmp
    -rw-r----- 1 root root   259 Jul 15 19:30 cron
    -rw-r----- 1 root root 17091 Jul 15 18:15 debug
    -rw-r--r-- 1 root root 50406 Jul 15 17:35 dmesg
    -rw-r--r-- 1 root root     0 Jul  2  2014 faillog
    -rw-r--r-- 1 root root     0 Apr  8  2000 lastlog
    -rw-r----- 1 root root     0 Jun 29 19:20 maillog
    -rw-r----- 1 root root 74729 Jul 15 21:51 messages
    -rw-r--r-- 1 root root  1124 Jul 15 18:15 pm-powersave.log
    -rw-r--r-- 1 root root  6086 Jul 15 18:15 pm-suspend.log
    -rw-r--r-- 1 root root  1266 Jul 15 17:34 porteus-livedbg
    -rw-r----- 1 root root  8376 Jul 15 21:56 secure
    -rw-r--r-- 1 root root    61 Jul 15 17:35 slim.log
    -rw-r----- 1 root root     0 Jun 29 19:20 spooler
    -rw-r----- 1 root root 10636 Jul 15 18:15 syslog
    -rw-r--r-- 1 root root  7296 Jul 15 17:35 wtmp
    
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: cp /from /to change in 3.2?

Post#5 by Ed_P » 15 Jul 2016, 20:24

:oops:

Ok, found part of the problem. I'm an idiot. :sorry: I wasn't deleting the /to directory between tests. :sorry:

I'm not done with my experiment so I may post more as this progresses.

Thank you for your patience Bogomips. :friends:
Ed

Post Reply