LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-06-2004, 10:18 PM   #1
MadDogE134
LQ Newbie
 
Registered: Jun 2004
Distribution: Mandrake 10
Posts: 9

Rep: Reputation: 0
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.
 
Old 06-06-2004, 10:26 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 58
ok well you can do this for ownership :
Code:
chown mad:users -R /home/mad/nwn
where "mad" is the username and "users" is the group your in ...

as of deleting :
Code:
rm file
and ...

Code:
rm -rf directory
becareful with that one

and thats it ...
 
Old 06-06-2004, 10:28 PM   #3
Squall
Member
 
Registered: Jan 2004
Location: The land of the free and the home of the brave
Distribution: Slack 10
Posts: 239

Rep: Reputation: 30
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.
 
Old 06-06-2004, 10:29 PM   #4
Squall
Member
 
Registered: Jan 2004
Location: The land of the free and the home of the brave
Distribution: Slack 10
Posts: 239

Rep: Reputation: 30
looks like DrOzz stuck in a response as I was typing.

echo DrOzz >> ~/enemies

(kidding)
 
Old 06-06-2004, 10:31 PM   #5
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 58
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
 
Old 06-06-2004, 11:08 PM   #6
MadDogE134
LQ Newbie
 
Registered: Jun 2004
Distribution: Mandrake 10
Posts: 9

Original Poster
Rep: Reputation: 0
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

Last edited by MadDogE134; 06-06-2004 at 11:17 PM.
 
Old 06-06-2004, 11:24 PM   #7
MadDogE134
LQ Newbie
 
Registered: Jun 2004
Distribution: Mandrake 10
Posts: 9

Original Poster
Rep: Reputation: 0
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

Last edited by MadDogE134; 06-06-2004 at 11:34 PM.
 
Old 06-06-2004, 11:40 PM   #8
MadDogE134
LQ Newbie
 
Registered: Jun 2004
Distribution: Mandrake 10
Posts: 9

Original Poster
Rep: Reputation: 0
chown mad -R /home/mad/nwn

using no group... worked like a charm

thnx again
 
Old 06-09-2004, 06:05 PM   #9
pokergeek
LQ Newbie
 
Registered: Dec 2003
Location: Denver, CO
Distribution: Mandrake
Posts: 13

Rep: Reputation: 0
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Strange permission issue. Problems changing ownership. ExCIA Linux - Newbie 6 05-26-2005 04:17 AM
unable to delete route-syntax problem? dthacker Linux - Networking 4 10-14-2004 11:23 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM
scp - peserve file ownership and permission eyt Linux - Newbie 6 10-24-2003 03:41 PM
permission or ownership problems trusouthrnplaya Linux - General 6 03-03-2002 03:33 PM


All times are GMT -5. The time now is 07:55 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration