Results 1 to 7 of 7

Thread: help copying folder contents only

  1. #1
    Join Date
    Jan 2012
    Beans
    167
    Distro
    Ubuntu 12.04 Precise Pangolin

    help copying folder contents only

    i know this is a reaaaally noob question but how can i copy the contents of a folder without copying the folder itself? here's what i have so far:
    Code:
    sudo cp -a /wubi/ /media/ubuntu/
    this gives me a folder called wubi inside /media/ubuntu/. i just want the contents of wubi. any ideas?
    If only I could grep life.......

  2. #2
    Join Date
    Jan 2009
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: help copying folder contents only

    Hi there, try this:

    Code:
    sudo cp -a /wubi/* /media/ubuntu/
    Note: Remove the slash in front of 'wubi' if the directory wubi is in your working directory. Having the slash will copy from /wubi, as opposed to /home/example/example/wubi.

    Hope that helps!

  3. #3
    Join Date
    Jan 2012
    Beans
    167
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: help copying folder contents only

    thanks
    If only I could grep life.......

  4. #4
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,205

    Re: help copying folder contents only

    Code:
    sudo cp -a /wubi/* /media/ubuntu/
    would work except for hidden files.

    You can use a simple script file like this
    Code:
    #! /bin/bash
    
    echo simple backup script using cp -auv SOURCE[directory]... DESTINATION_directory
    echo cp -auv $*
    echo press {ENTER} to continue or {CtrlC} to quit
    read
    cp -auv $*
    so that you can see what will be copied before you actually run the command.

    But when you get more used to linux, I suggest that you start using
    Code:
    rsync
    for such tasks. Read
    Code:
    man rsync
    to learn more about backing up or synchronizing directories.
    Last edited by sudodus; July 20th, 2012 at 02:13 PM. Reason: ubudog was faster

  5. #5
    Join Date
    Jan 2012
    Beans
    167
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: help copying folder contents only

    so which would be best for migrating my installation?
    If only I could grep life.......

  6. #6
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,205

    Re: help copying folder contents only

    Quote Originally Posted by z3nhakr View Post
    so which would be best for migrating my installation?
    Do you want to migrate to a normal installation with dual boot?

    Read this link https://help.ubuntu.com/community/MigrateWubi

  7. #7
    Join Date
    Jan 2012
    Beans
    167
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: help copying folder contents only

    thanks. actually google led me right to that page a few minutes after i made that post. it's all good now
    If only I could grep life.......

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •