Ownership/Permission and Delete Syntax
first newbie question... well... two of them i reckon :)
i have installed Neverwinter Nights with a Linux installer i found... all went fine except when i tried to install it to /home/mad/ (of which i am owner) it said i did not have permissions to install it. i don't know why it would not let me install as user... i had to be root as far as i could tell. so i went through the terminal and su'd to root and installed it that way... loaded like a dream with no hitch. game runs great... the problem is that after thinking about it... i do not like having to go to root to run it. (the root area is dangerous ground for newbies... unless you want to keep installing the OS ) i am running on Mandrake 10 Official Download. what i would like to know is two things... how to change ownership/permissions over from root to user (mad). i can see it under /home/mad/nwn but it has a padlock on it. what is the exact syntax for the command line in root ? also i would like to know the delete command syntax so i can remove unwanted items in the future. so in conclusion: syntax for ownership/permission syntax for delete command ty... any help would be appreciated. |
ok well you can do this for ownership :
Code:
chown mad:users -R /home/mad/nwn as of deleting : Code:
rm file Code:
rm -rf directory and thats it ... |
syntax for changing permissions
must do this a owner or root: chmod xxx file first x is owner permissions second x is group permissions thrid x is user permissions 4 = read 2 = write 1 = execute you may add them up, i.e. 6 = 2 + 4 = read + write for example chmod 731 would mean: owner: rwx group: wx user: x to change owner: chown user file (must be original owner) put a -r switch in to apply ownership to subdirectories delete syntax: rm file rm -rf directory (deletes directory) rmdir directory (deletes empty directory) type 'man command' for more info on a command. |
looks like DrOzz stuck in a response as I was typing.
echo DrOzz >> ~/enemies (kidding) |
oh and i forgot to mention as i look at it, that the first command for ownership has to be
ran as root user (obviously) but not sure if you would have known ;), but then again i am sure you would have figured that out when it said permission denied :p |
man... i started playing with computers when i was young... when you could only get programs by typing them in from magazines. taught myself BASIC that way on an old Radio Shack/Tandy Color Computer (CoCo). also had a couple years in college learning BASIC, Pascal, Assembly and Machine Languages... but that was SO long ago.
this is not far off from that in the way it works. i understand most of the concept and what to do... just have no documentaion. once i get the hang of the new syntax in linux i will be ok... but am interested in maybe teaching myself to program in Perl... heard it is a good language to program in. but kinda hated programming as a career... i prefered it to stay as a hobby. so thnx for the info and will give it a whirl. don't be suprized if i come here often for answers to my many questions. also it is easier for me to grasp by doing as opposed to just reading. sorta like pounding away at the keys years and years ago... old habits die hard :) |
hey squall...
so the chmod statement always uses a 3 digit #? first digit is the total for the root, second digit is total for the group and last digit is total permissions for the user? ok... that makes sense. but the change owner statement would be best for this situation i think since the /nwn/ is already in my user directory. and the remove statement is simple enough... but one more thing... what is default group for users? i don't recall adding myself into a group when i installed. thnx a lot both of you for your rapid response :) |
chown mad -R /home/mad/nwn
using no group... worked like a charm :) :D thnx again |
So how would I chmod files in subdirectories without screwing up the directories themselves?
From the top level of my home directory: $ chmod -R 644. After that, I can't cd into any directories. Apparently, removing x mode from a directory disables it as a directory. $ chmod -R 755. That lets me use everything, but then all non-executable files show up as executables in ls -F format. I'd like for non-executables to be listed as such. Any ideas? |
All times are GMT -5. The time now is 11:30 AM. |