File permissions?
Jim Byrnes
jf_byrnes at comcast.net
Fri Dec 25 22:03:00 UTC 2009
Tim Frost wrote:
> Jim,
>
> The reply from Fred Roller may shed some light.
>
> Ubuntu uses 'sudo xxx' to do 'xxx' as root. You may need it here. When
> sudo asks for a password, supply *your* password
>
> On Thu, 2009-12-24 at 21:09 -0600, Jim Byrnes wrote:
>> I've been using Ubuntu for about two weeks now and am starting to get
>> used to it. However, coming from an OS/2\Windows world file permissions
>> seem to be giving me some grief.
>>
>> Maybe if someone could tell me how to do a couple of specific tasks it
>> would become clearer to me. I have Jedit loaded on all three of my
>> OS's. I have modified some mode files on the other OS's I would like to
>> use on Ubuntu. I copied them to a shared folder on Ubuntu but I can't
>> copy them to /usr/share/jedit/modes which is where Jedit will look for them.
>
> Most packages support a per-user settings location, in the user home
> directory. For jedit, this is the directory $HOME/.jedit, which you
> own. If you put the customised modes in directory $HOME/.jedit/modes,
> you should have them accessible to you, and you can modify them safely.
> This makes them available to you, but not to other users on the Ubuntu
> system.
>
> To make them available to other users, you need to install the modified
> files in /usr/share/jedit/modes. Rules for directory permissions are
> more complex than for files:
> * To create or delete a FILE in the directory, I need WRITE permissions
> on the directory (not the file - but rm will warn if I try to remove a
> file I can't write to)
> * to edit a file, I need read/write permissions on the file, but not the
> directory.
> (This is because of the way that linux/unix stores permissions and
> ownership information)
>
> If you need to put the mode files into /usr/share/jedit/modes, the
> following will allow you to do that:
> sudo cp -p <my-mode-files> /usr/share/jedit/modes
>
> Using sudo will allow the copy to change the permissions, and add new
> files into the directory. The '-p' option will preserve permissions
> (including the fact that you own the files) when copying them. This
> means that you should have the modified files available for all users,
> and you should be able to update them (including copying replacements
> from the other computers) without needing to use sudo [unless you want
> to modify a file that you don't yet own on the ubuntu machine).
>
>
>> In that same vein, if I wanted to edit one of those files with Jedit how
>> could I get Jedit to open it for editing?
>
> You can give yourself the ability to edit all of the files in the
> directory /usr/share/jedit/modes, with
> sudo chown $USER /usr/share/jedit/modes/*
>
>
>> Thanks, Jim
>>
>
> One caveat here:
> Because the files in /usr/share/jedit/modes are part of the jedit
> package, you may find that they get overwritten when you use the package
> management system to upgrade jedit. For that reason, it is safer to use
> $HOME/.jedit/modes, which won't be touched by a package upgrade.
>
> Tim
>
>
>
I wondered about the upgrading problem when I finally figured out where
the install put everything. I was just starting to realize the reason
for the stuff under home/ and now you post confirms it for me.
You and other posters have mentioned enviromental variables like $HOME.
In OS/2 they are set in config.sys, where are they set in Ubuntu?
Thanks, Jim
More information about the ubuntu-users
mailing list