LinuxQuestions.org
Help answer threads with 0 replies.
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-07-2011, 06:45 PM   #1
j360
Member
 
Registered: Jan 2010
Location: Maryland
Distribution: Ubuntu
Posts: 58

Rep: Reputation: 0
Cool CLI configuration


I've been doing some C programming over the last days using VI. suddenly every time I compiled a program it doesn't change the color of its font indicating it's an executable or a .c file. All my previous programs are green which were originally, but now every time I compiled write a program its text color is white, which is the default font color on terminal. I have changed the font color on my profile and still. It doesn't affect my files at all, I just would like to know why this is happening.
 
Old 06-07-2011, 07:43 PM   #2
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
1. Does "ls" generally shows colors? If not you might try "ls --color".
2. Is the compiled file really executable? "ls -l" will tell you. If it's not, then you need to chmod it.
 
Old 06-07-2011, 08:01 PM   #3
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
If you like that option I would suggest placing an alias in /etc/bash.bashrc file.

 
Old 06-07-2011, 08:05 PM   #4
j360
Member
 
Registered: Jan 2010
Location: Maryland
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 0
ok thanks, I fixed that using chmod. They are executable now.
the problem now is how to stop it from doing the same thing over again. I'm not very familiar with the terminal Every time I create a new file it doesn't give me the executable permission. How can I change it so I have all permissions?
 
Old 06-08-2011, 05:44 AM   #5
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
You can't have it on by default. What I gather is that since most files are not "executable" the default setting is 0666. What option you do have is to set the umask value in your /etc/bash.bashrc file. The umask value then can be subtracted from this increasing security. You could set to 000. So at best your files by default will have read/write permissions for User , Groups and Others.

Another option might be to write a script to run as a cron job continuously ( or maybe every 15 minutes or so,you may not want to chew up resources)

Quote:
#! /bin/bash
chmod 0750 /path/to/target/*


----------------

Then set up as a root cron job:


su -
password

crontab -e

m h dom mon dow command
* * * * * /path/to_your_script/Script





Hope this helps.
 
Old 06-08-2011, 09:58 AM   #6
roygbiiv
LQ Newbie
 
Registered: May 2011
Distribution: Arch Linux
Posts: 25

Rep: Reputation: 13
Yep, you just chmod +x <your c file>, or chmod +x *.c

Last edited by roygbiiv; 06-08-2011 at 03:20 PM.
 
Old 06-09-2011, 08:11 PM   #7
j360
Member
 
Registered: Jan 2010
Location: Maryland
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 0
Cool

thanks everyone, I tried different things like chmod -R 777 or taking ownership with chown. Still it wouldn't give me the permission. I have to be doing chmod +x *.c all the time
 
  


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
CLI h2l LinuxQuestions.org Member Intro 4 08-03-2009 08:37 PM
ifconfig configuration changes are not reflected in the network configuration GUI nkd Linux - Networking 4 12-25-2008 02:17 PM
Saving CLI data in the CLI Tons of Fun Linux - General 4 04-03-2007 06:42 AM
I'll CLI oneandoneis2 General 8 01-26-2006 02:41 PM
More CLI! NSKL Linux - General 3 12-02-2002 09:52 PM


All times are GMT -5. The time now is 10:19 AM.

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