LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trouble moving files (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-moving-files-599186/)

Labrat21 11-12-2007 08:29 PM

trouble moving files
 
I am totally new to linux. I am practicing simple commands. Currently i am only able to mv files to subdirectories. for example if I have two directories, directory 1 (which contains file JOKES and subdirectory 1) and directory 2 (which contains no files). I am able to mv the JOKES file to subdirectory 1, but I am unable to mv the JOKES file to directory 2.

Basically I can mv files down, but not up. I hope this is clear

thanks in advance for any help.

jschiwal 11-12-2007 08:39 PM

It isn't clear. You might want to post what commands you are trying. Also, your directory names seem to contain spaces, so you need to escape the spaces with backslashes or use quotes.

matthewg42 11-12-2007 08:46 PM

Every directory and file has an owner - a user account on the system which has ultimate control of the file or directory.

If you are in the terminal, you can see this when you do the "ls -l" command. For example, an except of the output of the ls -l command in my home directory:
Code:

$ ls -l
total 13
drwxr-xr-x 13 matthew matthew 4096 2007-11-12 17:57 Desktop/
drwxr-xr-x 28 matthew matthew 4096 2007-10-20 04:05 documents/

The owner is the third column (in this case my user name "matthew").

In combination with the permissions on the directory (represented in the first column), this control who may create or rename files in that directory.

Each user has their own directory in /home.... in my case /home/matthew. This is where I am expected to store all my files. All other parts of the directory tree will be owned bu other user accounts on the system (if there are others... each will have their own directory in /home), or special system users - mostly "root".

Most of the programs and data files used by program on the system will be owned by the root user (the system administration user), and may not be touched by your normal user. This is a good protection for your system. Imagine if you visit a web page which exploits some security flaw in the browser... the browser runs as your user, so it cannot alter program files and so on. This can be helpful to keep your system safe.

If you don't care so much about the why, just know that you should keep all your files in your home directory. If you want to know how and why it works, have a read about Linux file permissions.

matthewg42 11-12-2007 08:49 PM

Here's another nice article on the topic: http://www.linuxforums.org/security/...rmissions.html

Labrat21 11-12-2007 08:56 PM

Thank you
 
Thanks so much for your help. With your help I was able to correct my problems. I wasn't working from /home

Thanks again

LlNUX 11-13-2007 01:39 AM

check mv command for some examples:

linux commands

hope this helps


All times are GMT -5. The time now is 03:11 AM.