LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-08-2011, 08:56 AM   #1
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Rep: Reputation: 0
Exclamation How to permanent change permission of a file?


Hello,
I have a c file, and I want to open it but not in the terminal.
After changing the permission, I tried:
vi, pico, ed and vim
But, all open it in the terminal.

How can I change the permission of that file to be opened and edited not in the terminal?
When I change the permission from the terminal, it only let me edit it through the terminal, and when I check the permission of the file I see it as was it (no change).
I need a permanent permission.
Although, I command as a root.

Thanks in advanced.
 
Old 06-08-2011, 09:18 AM   #2
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
What happens if you open a GUI editor and from it's menu browse for that file?
Are you creating the file as root, but in another user's directory? Then only root can edit the file.
Create it as the user you want to edit it, or chown it.
Vi, pico, nano etc all command-line editors. Gvim, Kwrite, nedit, gedit are GUI editors.

Edit: When you change the permissions on terminal, they don't change just for terminal. They change for everything.

Last edited by segmentation_fault; 06-08-2011 at 09:20 AM.
 
1 members found this post helpful.
Old 06-08-2011, 09:24 AM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Quote:
vi, pico, ed and vim
They are all CLI editors. Try opening it in one of GUI editors (eg. gedit, kate, gvim, emacs, etc.)
 
1 members found this post helpful.
Old 06-08-2011, 09:32 AM   #4
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
The file is the root.
After changing permission from terminal using:
chmod +rwx /usr/local/etc/motion/motion.c

But when I right click on motion.c -> properties -> permission
I see the last permission.(off Gray, can't be changed)
when I try gedit, it only open with out any editing supporting.

I there any way, neither copy the file in the home and modify it then replace the original in the root?

Last edited by MODYSAMA; 06-08-2011 at 09:33 AM.
 
Old 06-08-2011, 09:37 AM   #5
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,227

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
sounds like you don't have permission to modify the directory the file is sitting in.
 
Old 06-08-2011, 09:44 AM   #6
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
I think you shouldn't work on that directories when compiling etc. Copy the file to your user's home, edit/work with it as a regular user, and when you are done place it where you want it to be.
 
1 members found this post helpful.
Old 06-08-2011, 09:47 AM   #7
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Ok.. thanks segmentation_fault.
 
Old 06-08-2011, 10:05 AM   #8
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
Glad I helped.
You could mark the thread as 'solved' (Thread tools at the top).
 
  


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
Change file permission elainelaw Linux - Newbie 4 12-15-2010 07:05 AM
Any log file for checking file permission change history in RHEL 5.1? bilalcochin Linux - Newbie 3 04-02-2010 10:57 AM
change file permission of a mouse device file permanently alexandre_fs Linux - General 5 01-09-2007 07:30 AM
how to change the file permission ?? AK prince Slackware 17 08-05-2005 01:16 PM
Cannot Change File Permission dsuratman Linux - Newbie 12 11-03-2003 02:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:43 PM.

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