LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-26-2011, 05:21 PM   #1
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Rep: Reputation: 32
how do i give the live user root privelages


i am trying to recover some files on a partition through the ubuntu live cd (they are hidden files and i can't find anything else that would work) and it said i needed root privaleges in order to copy them. is this possible and how do i do it
 
Old 02-26-2011, 05:27 PM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetingz!

One way would be to use a Terminal session. Try "sudo cp /source/path /destination/path", and check out "man cp" and "man sudo" when you get a chance.
 
Old 02-26-2011, 05:36 PM   #3
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
what will be the names of the flash drive and the partition and will it copy hidden files?
 
Old 02-26-2011, 06:31 PM   #4
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
but how do i navigate to directories with spaces in the title
 
Old 02-26-2011, 06:36 PM   #5
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
or copy from directories with spaces in the title

and then how do i copy hidden files to a directory

Last edited by baronobeefdip; 02-26-2011 at 06:45 PM.
 
Old 02-26-2011, 06:39 PM   #6
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
If you insert the flash drive after Ubuntu desktop is running then it should automatically mount the drive under the unprivileged user and create a icon on the desktop. Double click on the icon to launch nautilus.

Using the command line to copy file from or to a directory with spaces in the name is easy. Just put the part of the directory name with the spaces in quotes as follows:
Code:
cp testfile /"directory with spaces in the name"
 
Old 02-26-2011, 07:14 PM   #7
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
alright now copy a directory with spaces to a directory with spaces goes like this?
Code:
*sudo cp -r /"directory with spaces" /"destination directory with spaces"
 
Old 02-26-2011, 07:22 PM   #8
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
i just inserted the flash drive that has all of the files that i copied which were unprivileged but it looks like it mounted, an icon comes up in places but theres no icon on the desktop and it's inaccessible when i try to access it through places how do i mount it so i can access it through command line

but now how do i copy the contents of a directory to a directory (copy all of whats inside the folder into another directory, not the folder itself)

Last edited by baronobeefdip; 02-26-2011 at 07:32 PM.
 
Old 02-26-2011, 10:23 PM   #9
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Whoa, whoa, whoa. Slow down there, baronbeefdip.

1) what will be the names of the flash drive and the partition?
Good question. Try checking the output of "dmesg" and maybe "fdisk -l /dev/[sh]d[a-z] | grep dev".
You could follow stress_junkie's advice. If you plug in a new USB device, just "dmesg|tail -50" to check the last device name that was recognized by the system.

2) Will it copy hidden files?
"Hidden" files, as in those files that have a dot as their first character? Yes.

3) How do I copy files/directories with spaces in their names?
Well, for starters, don't create them. They're a hassle. However, you can do it like so;
Code:
sudo cp -p "/source/directory with spaces/" "/destination/directory with spaces/"
Note that the command you put in your previous post will not work. Your quotes are in the wrong spot.

Quote:
Originally Posted by baronobeefdip View Post
i just inserted the flash drive that has all of the files that i copied which were unprivileged
Sounds like your USB stick is using vfat (maybe FAT32) as a filesystem. That filesystem does not have support for UNIX-style permissions/ownership, so everything will "default" to the username+group+umask of the user that mounts the device. To correct that (if your interested), you would have to do something like this;
Code:
mount -t vfat -o uid=uid_number,gid=gid_number,umask=007 /dev/device /mount/point
uid_number == The User ID Number for the user that will "own" all files on that filesystem.
gid_number == Same as above. The "Group ID number" specified is what will "own" the filesystem.
007 == Read the manpage for umask. A 007 umask will give the "owner" and "group" full access to the mounted filesystem, while the last digit (7), will prohibit anyone that's not the "owner" and not a member of that group from accessing the files.

Quote:
Originally Posted by baronobeefdip View Post
but it looks like it mounted
That's great. Pop open a Terminal (xterm, konsole, gnome-console, eterm. Whichever you like) and run the following command;
Code:
df -h
That will tell you what's mounted where. Your USB thingy might be mounted to a sub-directory of /media. (If there's an Ubuntu die-hard reading, feel free to correct me if I'm wrong.)

Quote:
Originally Posted by baronobeefdip View Post
an icon comes up in places but there's no icon on the desktop and it's inaccessible when i try to access it through places how do i mount it so i can access it through command line
Well, I'm no fan of GUIs. So I tend to disable services that auto-mount devices for me. I would recommend you use the "df" command to see if the USB thingy is mounted, then just browse to that location.
As for there not being an icon on your desktop....well, I can't help you there.

Quote:
Originally Posted by baronobeefdip View Post
but now how do i copy the contents of a directory to a directory (copy all of whats inside the folder into another directory, not the folder itself)
Okay....if you want to copy everything in a directory, but not the directory itself, and you want to copy all the hidden files, too. That's a bit tricky.
This should work;
Code:
sudo cp -p "/source/directory with spaces/*"    "/destination/directory with spaces/" && \
sudo cp -p "/source/directory with spaces/.??*" "/destination/directory with spaces/"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Give user root priviledges tekmann33 Linux - General 13 08-01-2011 08:28 PM
How to give user always root privileges? SimeonV SUSE / openSUSE 18 06-23-2005 11:02 AM
How can I give myself root priv's as a user? Mr. Hill Linux - Newbie 9 06-12-2005 02:19 PM
Mandrake 10.1 Giving User Account all Root Privelages morbid81 Mandriva 3 01-14-2005 01:21 AM
give root privilleges to a user atlonyx Linux - General 9 08-02-2004 01:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration