Terminal command Guru needed!

Discussion in 'Mac Apps and Mac App Store' started by meta-ghost, May 25, 2004.

  1. meta-ghost macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #1
    Serious problem here, any help and i'd be grateful. been backing up multiple users onto dvd's from my (the admin account). i just installed panther and wiped my hard drive clean. trouble is, the other user documents may have not had the proper permissions setup for this and while they copied onto the dvd (and i can open each document from the disk) i can't copy them back to the hard drive.

    i tried everything. disk utility, toast, holding the option key down, and more. the "get info" window only has "read only" option. my last thought is some sort of terminal commands. anybody?
     
  2. dragula53 macrumors regular

    Joined:
    Jun 23, 2003
    #2
    that is weird.

    umm....
    from the terminal window, do like this:
    df (to make sure that the volume is as I say)
    it should say something like: /dev/disk1 <disk name> (whatever you named your dvd)
    cd /Volumes/<diskname>
    (note that if the name is Audio CD, for example, you can type Au*, and it will go to it, unix R smart)
    or even easier..
    sudo cp * ~/Desktop
    enter admin password
    that should force it to copy everything on the DVD to your desktop

    or you can be more specific, and do other paths, or copy specific stuff, etc.

    sudo cp -R * ~/Desktop will do all directories recursively

    or

    sudo cp -R * /Users

    if you are just gonna cram it all into the users directory...
     
  3. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #3
    thanks dragula. i'm a bit of a terminal newbie. used it once or twice in the past. i tried your commands but no action happened (see below). ideally i'd like to take just one of the top most folders off the disk.

    dsl081-070-009:~ eskiba$ sudo cp*~/desktop
    sudo: cp*~/desktop: command not found
    dsl081-070-009:~ eskiba$ sudo cp* ~/Desktop
    sudo: cp*: command not found
    dsl081-070-009:~ eskiba$ sudo cp -R ~/Desktop
    usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src target
    cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src1 ... srcN directory
    dsl081-070-009:~ eskiba$ sudo cp -R /Users
    usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src target
    cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src1 ... srcN directory
    dsl081-070-009:~ eskiba$
     
  4. Westside guy macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #4
    It's all about spacing. You need to hit the spacebar on occasion. :D

    sudo[space]cp[space]*[space]~/desktop
     
  5. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #5
    ok, what am i missing? it asked for and took my password but still no action...

    Last login: Tue May 25 22:06:02 on ttyp2
    Welcome to Darwin!
    dsl081-070-009:~ eskiba$ sudo cp * ~/desktop
    Password:
    dsl081-070-009:~ eskiba$
     
  6. cait-sith macrumors regular

    Joined:
    Apr 6, 2004
    Location:
    canada
    #6
    ~/desktop and ~/Desktop are different things.

    type in the commands EXACTLY as they are shown to you.
     
  7. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #7
    And you still need to do the "cd /Volumes/DVDName".
     
  8. dragula53 macrumors regular

    Joined:
    Jun 23, 2003
    #8
    unix

    is case sensitive

    so everything needs to be exact.

    cd /Volumes/<disk name>
    cp -R * ~/Desktop (upper case R, upper case D, etc)

    you also didn't "df" to find out what your disk name was.
    so it should go more like this, sorry for being not specific enough the first time..
    open terminal
    type:

    df

    look for the /dev/disk1 line. there should be a name after it (My DVD maybe?)

    cd /Volumes/<disk name>

    (remember upper case V, and you can type My* to get to "My DVD")

    sudo cp -R * ~/Desktop

    (upper case R, spaces, upper case D)
     
  9. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #9
    sorry guys but i'm not there yet... was trying to copy all to desktop. to icons appeared "Desktop DF" and "Desktop DB" which are "unix executable files" but are too small to represent all of the data. here is the terminal action:

    Welcome to Darwin!
    dsl081-070-009:~ eskiba$ df
    Filesystem 512-blocks Used Avail Capacity Mounted on
    /dev/disk0s9 78157200 28318448 49326752 36% /
    devfs 200 200 0 100% /dev
    fdesc 2 2 0 100% /dev
    <volfs> 1024 1024 0 100% /.vol
    /dev/disk1s9 240098256 140156456 99941800 58% /Volumes/Films
    automount -nsl [303] 0 0 0 100% /Network
    automount -fstab [315] 0 0 0 100% /automount/Servers
    automount -static [315] 0 0 0 100% /automount/static
    /dev/disk2 8467180 8467180 0 100% /Volumes/GeneralDocBackup
    dsl081-070-009:~ eskiba$ cd /Volumes/GeneralDocBackup
    dsl081-070-009:/Volumes/GeneralDocBackup eskiba$ sudo cp * ~/Desktop
    Password:
    dsl081-070-009:/Volumes/GeneralDocBackup eskiba$
     
  10. Westside guy macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #10
    Actually on OS X this is incorrect - OS X is case-preserving but case-insensitive. If you don't believe me give it a try.

    Tabbed autocomplete won't work if you don't capitalize correctly, but you can still traverse directories.
     
  11. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #11
    say westside, if i do "sudo cp -R * ~/Desktop" will it put into and override any data in directories such as my library?
     
  12. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #12
    It will overwrite anything with the same name on your desktop, but NOT in your library or other directories. I'd recommend creating a directory inside your desktop to hold the copy: "mkdir ~/Desktop/dvdcopy" then copying the contents of the DVD to it: "sudo cp -R * ~/Desktop/dvdcopy". That way, nothing gets overwritten.
     
  13. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #13
    sorry mate, but nothing seems to be happening... i assume by "dvdcopy" you mean the name of the dvd (in my case GeneralDocBackup). i made the folder with the name "mkdir ~/Desktop/GeneralDocBackup". here is what was done in the terminal:

    Welcome to Darwin!
    dsl081-070-009:~ eskiba$ df
    Filesystem 512-blocks Used Avail Capacity Mounted on
    /dev/disk0s9 78157200 28753520 48891680 37% /
    devfs 200 200 0 100% /dev
    fdesc 2 2 0 100% /dev
    <volfs> 1024 1024 0 100% /.vol
    /dev/disk1s9 240098256 140156552 99941704 58% /Volumes/Films
    automount -nsl [303] 0 0 0 100% /Network
    automount -fstab [315] 0 0 0 100% /automount/Servers
    automount -static [315] 0 0 0 100% /automount/static
    /dev/disk2 8467180 8467180 0 100% /Volumes/GeneralDocBackup
    dsl081-070-009:~ eskiba$ cd /Volumes/GeneralDocBackup
    dsl081-070-009:/Volumes/GeneralDocBackup eskiba$ sudo cp -R * ~/Desktop/GeneralDocBackup
    Password:
    usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src target
    cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src1 ... srcN directory
    dsl081-070-009:/Volumes/GeneralDocBackup eskiba$
     
  14. GiantsFan macrumors member

    Joined:
    May 15, 2004
    Location:
    san jose OR riverside, Cali
    #14
    uh, does anyone know how to change the default of " ls " ? when i type in " alias ls " it shows that is " ls -f ". i dont want the " -f ", just " ls ".
     
  15. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #15
    OK - I think I've figured out what's going on. The cp command is complaining that you're using invalid syntax. Here's what you wanted: "sudo cp -R /Volumes/GeneralDocBackup ~/Desktop/GeneralDocBackup" (without the quotes, of course).
     
  16. ThomasW macrumors member

    Joined:
    Nov 27, 2003
    #16
    You shouldn't use the cp command at all!!

    All files with resource forks will be damaged after they're copied with cp. You should really use CpMac, which is included with the developer tools.
     
  17. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #17
    i looks like your correct. as i write this message the documents are being copied with an error message and landing on my machine with 0 (zero)kb file size. i have "Developer Tools" version 10.1. is it difficult to use the CpMac?

    terminal commands are as follows:

    Last login: Wed May 26 08:13:09 on ttyp2
    Welcome to Darwin!
    dsl081-070-009:~ eskiba$ df
    Filesystem 512-blocks Used Avail Capacity Mounted on
    /dev/disk0s9 78157200 28753520 48891680 37% /
    devfs 200 200 0 100% /dev
    fdesc 2 2 0 100% /dev
    <volfs> 1024 1024 0 100% /.vol
    /dev/disk1s9 240098256 140156552 99941704 58% /Volumes/Films
    automount -nsl [303] 0 0 0 100% /Network
    automount -fstab [315] 0 0 0 100% /automount/Servers
    automount -static [315] 0 0 0 100% /automount/static
    /dev/disk2 8467180 8467180 0 100% /Volumes/GeneralDocBackup
    dsl081-070-009:~ eskiba$ cd /Volumes/GeneralDocBackup
    dsl081-070-009:/Volumes/GeneralDocBackup eskiba$ sudo cp -R * ~/Desktop/GeneralDocBackup
    Password:
    usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src target
    cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src1 ... srcN directory
    dsl081-070-009:/Volumes/GeneralDocBackup eskiba$ sudo cp -R * ~/Desktop
    Password:
    cp: Quicken Essentials/Backup Folder/6Quicken Data: Input/output error
    cp: Quicken Essentials/Backup Folder/1Quicken Data: Input/output error
    cp: Quicken Essentials/Backup Folder/21Quicken Data: Input/output error
    cp: Quicken Essentials/Backup Folder/2Quicken Data: Input/output error
    cp: Quicken Essentials/Backup Folder/31Quicken Data: Input/output error
     
  18. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #18
    No, use the ditto command instead with the -rsrcFork switch. That doesn't require the developer tools and will do the same thing.
     
  19. MrBubbles macrumors member

    Joined:
    Apr 8, 2003
    Location:
    Mad City
    #19
    The short answer is to type "unalias ls". To make the change more permanent you have to edit a shell startup script. First figure out which shell you're using (bash or csh) by typing "echo $SHELL". Then, edit the appropriate files in either your home directory or in /etc (assuming you have administrator privileges). Bash uses [.]bashrc and [.bash_]profile, while csh uses [csh].cshrc and csh.login.

    For more (just as confusing) information on bash, csh, or ls, consult the man pages (e.g., "man bash").
     
  20. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #20
    btw, anybody know how to stop this copying (which is a bit slow) happening through the terminal as i write this. end, quit, stop and logout haven't worked. (i know, i know i shouldn't be using the terminal...)
     
  21. meta-ghost thread starter macrumors regular

    Joined:
    Apr 9, 2002
    Location:
    San Francisco
    #21
    sorry for my ignorance, but what exactly do you mean? are the files being copied still usable?
     
  22. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #22
    open a new terminal window and type "killall cp". Alternatively, you can open a new terminal window, type "top", make a note of the PID of the active "cp" process (the one using CPU time), quit top by pressing q, then type "kill -9 [PID]" where [PID] is the PID you noted earlier. That should stop it.
     
  23. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #23
    ditto is like cp, but it has the ability to preserve resource forks with the -rsrcFork switch. It can be used even if the developer tools aren't installed; it's the command line utility Carbon Copy Cloner uses to duplicate disks. As far as usability goes, all your files will remain intact when copied with ditto, even if they had resource forks.
     
  24. JFreak macrumors 68040

    JFreak

    Joined:
    Jul 11, 2003
    Location:
    Tampere, Finland
    #24
    usually control-c cancels whatever you have executed in the terminal.
     
  25. Anticipat3 macrumors regular

    Joined:
    Jan 30, 2003
    Location:
    Madison, Wisconsin
    #25
    OK... I'm a little surprised at all this feedback and no good answers.

    If you have read access to everything, this isn't a hard problem to fix.

    First, make sure the disc is mounted.
    Next, make a "Junk" folder on your desktop.

    now open a terminal. type these commands:
    sudo bash (will log you in as root)
    cp -R /Volumes/DVDName/* ~/Desktop/Junk

    now it's time to fix the permissions. type these:
    chown -R [yourusername] ~/Desktop/Junk/* (makes you the owner)
    chmod -R +rw ~/Desktop/Junk/* (gives you read and write permission).

    There you go.
     

Share This Page