How do I move a folder to a protected folder in Ubuntu 10.10

Asked by Polyprogrammer

 I have run into a problem where I need to move a folder of web files from the Desktop to the htdocs folder. It seems that my php files will not properly execute until this has been done. The file browser returns a "permission denied" error when I attempt to move this folder. How do I get this to work? I do not get any "password" inquiries. I am new to Ubuntu and am really enjoying it greatly. I am not familiar with any of the Linux "command line" scripts yet. I am clearly missing something that I am not familiar with yet! I believe I may need to somehow become a "root" level user on the file browser and I have not been able to find out how to do this.

I am using Ubuntu 10.10 - with the gnome desktop.

I have also tried using the KDE File Manager (Super User Mode) with the same results.

This is my personal laptop and I thought I had full access (I am the only user - ever!) although the system states that I do not "own" these folders (very funny).

Source: user/Desktop/MyWebFiles/<myfoldername>

Destination: opt/lampp/htdocs/<myfoldername>

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nautilus Edit question
Assignee:
No assignee Edit question
Solved by:
peter
Solved:
Last query:
Last reply:
Revision history for this message
Eliah Kagan (degeneracypressure) said :
#1

Running Nautilus (the GNOME file manager) or Dolphin (the KDE file manager) as root (the superuser) should work. Just keep in mind that if you're copying/cutting and pasting, both the source and destination folder views should be in windows running as root.

To run Nautilus as root, press Alt+F2 and run the command "gksu nautilus" (without the quotes).

If you want to use the command-line, then open a Terminal window (Applications > Accessories > Terminal ...or, if you're in a Kubuntu Desktop Session, use Konsole), and run the command:

sudo mv /home/<username>/Desktop/MyWebFiles/<myfoldername> /opt/lampp/htdocs/<myfoldername>

That will work for moving a folder from one place to another on the same volume.

You might prefer to *copy* the folder instead. To copy a folder and its contents with the cp command, you must use the -R flag:

sudo cp -R /home/<username>/Desktop/MyWebFiles/<myfoldername> /opt/lampp/htdocs/<myfoldername>

When you run commands in a terminal, you must escape any spaces\ in\ filenames by preceding them with a \ (backslash). Alternatively, you can include the entire filename in 'single quotes' or "double quotes".

You might be asked for your password when you run commands that start with "sudo". While entering it, you will not see any placeholder characters (like *). That's OK.

You may want to back up files, before running commands for the first time that operate on them. It would be unfortunate if you lost your work because of mistakes on the command line.

For more information about dealing with files on the command line, see:
http://manpages.ubuntu.com/manpages/maverick/en/man1/bash.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/cd.1posix.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/ls.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/cp.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/mv.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/chmod.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/chown.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/chgrp.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/touch.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/rm.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/mkdir.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/rmdir.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/ln.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/cat.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/less.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/file.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/find.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/locate.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man8/updatedb.8.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/grep.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man8/sudo.8.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/nano.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/vim.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/du.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/df.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man8/mount.8.html
http://manpages.ubuntu.com/manpages/maverick/en/man1/udisks.1.html
http://manpages.ubuntu.com/manpages/maverick/en/man8/fsck.8.html
http://manpages.ubuntu.com/manpages/maverick/en/man8/fdisk.8.html
http://manpages.ubuntu.com/manpages/maverick/en/man8/parted.8.html

Also, please note that while you're the only user in the sense that you're the only person who can log on, you're not actually the only user account on the system. Besides your user account and the root user account, there are a number of other user accounts, used for special purposes. (It is generally not possible to actually log on as these special users.) You can see a list by running this command in the Terminal:

cat /etc/passwd

(For a text-scrollable list, replace "cat" with "less".)

You might find that files have to be owned by /opt/lampp/htdocs have to be owned by the "user" called www-data in order to be made available by the web server.

Please feel free to post again if you need further assistance.

Revision history for this message
Best peter (peter-neuweiler) said :
#2

In a terminal enter gksudo nautilus. This will run the super user mode.
Peter

Revision history for this message
Polyprogrammer (electro-group) said :
#3

First, I am really enjoying my move over to Linux and would like to thank all of you for your support. The tips offered worked very well. From the information provided i was able to first move my folder and subsequently run it. Your guidance helped me to also figure out to create a "Launcher" for geditor as Super User. Since I never allow my computer to stay connected to the Internet I can take more liberties with my system.
 I created a Launcher with the Name set at "gedit - Editor as Super user".
 I then set the command to "gksu /usr/bin/gedit" this allows me to edit and save my files in the "protected folders".

GUI's have spoiled me and now I need to relearn the techniques I once knew from using RT11, CPM, DOS and UNIX. (those were old days - anyone remember "Electric Pencil"?)

I have learned from using windows to never stay connected to the Internet but the downside is that far to many sites do not provide "offline Documentation". Since I am also often away from any Internet connection (or cellphone coverage) this has been a major inconvenience. Not a surprise as it has been my experience that most programmers are not familiar with possibilities outside of their own personal experience. This was the major failing of Windows and its lack of ability to learn.

Thanks again, everyone.