LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-08-2018, 11:44 AM   #1
jwestjr
LQ Newbie
 
Registered: Jul 2013
Location: Houma, Louisiana
Distribution: Ubuntu 18.00
Posts: 15

Rep: Reputation: Disabled
Smile chmod software


I've tried all kinds of forms for the chmod command. None of them work. I used the sudo command in case it was for permission reasons and that did not work. I tried info and man, and they don't really make it clear. I am trying to change the permissions to write and execute on a file. Can anyone tell me what the correct format for this command is?

e.g. chmod -v "+wx" bash.bashrc

is what I am trying to do. Not working. What am I doing wrong?

HELP

Joe

Using Acer Predator 17 computer with 18.0 linux Ubuntu, 16G RAM, 256G storage.
 
Old 10-08-2018, 12:40 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,318

Rep: Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017
Quote:
Originally Posted by jwestjr View Post
I've tried all kinds of forms for the chmod command. None of them work. I used the sudo command in case it was for permission reasons and that did not work. I tried info and man, and they don't really make it clear. I am trying to change the permissions to write and execute on a file. Can anyone tell me what the correct format for this command is?

e.g. chmod -v "+wx" bash.bashrc

is what I am trying to do. Not working. What am I doing wrong? Using Acer Predator 17 computer with 18.0 linux Ubuntu, 16G RAM, 256G storage.
Since all you've told us is "did not work", we have no idea. That exact command worked fine on a file on my system. The man page for chmod can tell you all of the options, but without knowing what the error(s)/message(s)/behavior(s) you're seeing, we can't tell you what might be wrong.

I *CAN* tell you that there is no 'bash.bashrc' file on most systems, so unless you created it, it probably won't be found. And unless you specify the path to that file, it'll only look in the current directory. And if it doesn't find it, it won't work. And if you're just trying to change your .bashrc file to write/execute...you're going to have a LOT of fun next time you log in, since that file won't be able to be *READ* (meaning nothing in that file will RUN). Permissions on a .bashrc file are typically '-rw-r--r--', with it being owned by the user, and group ownership of the users primary group.

Permissions are easier to change (in my opinion) by number, rather than the letters.

4 = Read
2 = Write
1 = Execute

..so a file with -rwxr-xr-x would be 755. The three numbers stand for owner, group, other. So to make it write/execute for all, it would be 333 (chmod 333 <filename>). After being here for five years, you really should read the "Question Guidelines" link in my posting signature. We are always happy to help, but do basic research first, and post details. Just putting "linux file permssions" into Google pulls up:
http://linuxcommand.org/lc3_lts0090.php
 
Old 10-08-2018, 12:47 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,523

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
bash.bashrc is a system wide bashrc file and read from /etc/profile. There is no reason to change its permissions and the typical way of invoking changes made to a profile script is to log out and log back in.

What problem are you trying to solve?
 
1 members found this post helpful.
Old 10-08-2018, 12:48 PM   #4
rigor
Member
 
Registered: Sep 2011
Posts: 298

Rep: Reputation: Disabled
Quote:
Originally Posted by jwestjr View Post
...

e.g. chmod -v "+wx" bash.bashrc

is what I am trying to do. Not working. What am I doing wrong?

...Using Acer Predator 17 computer with 18.0 linux Ubuntu, 16G RAM, 256G storage.
In the environment I am using, I believe that:
Code:
chmod -v "+wx" bash.bashrc
would be equivalent to:
Code:
chmod -v "a+wx" bash.bashrc
Although, if you are trying to change permissions on /etc/bash.bashrc then there may be broader issues involved in the situation. AFAIK, you often shouldn't need to change permissions on that file since it is handled at a level where those permissions shouldn't cause a problem.

It could be helpful to know if that is the file you are trying to change, if so, why, and are you getting any error message when you try to change the permissions; to have more details in general.
 
2 members found this post helpful.
Old 10-08-2018, 01:01 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,318

Rep: Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017Reputation: 6017
Quote:
Originally Posted by michaelk View Post
bash.bashrc is a system wide bashrc file and read from /etc/profile. There is no reason to change its permissions and the typical way of invoking changes made to a profile script is to log out and log back in.

What problem are you trying to solve?
Didn't even think about that file, michaelk...was assuming the OP meant .bashrc in home directory. Although the sudo mention should have prodded that.
 
Old 10-08-2018, 03:37 PM   #6
jwestjr
LQ Newbie
 
Registered: Jul 2013
Location: Houma, Louisiana
Distribution: Ubuntu 18.00
Posts: 15

Original Poster
Rep: Reputation: Disabled
bash.bashrc file

Actually, I am simply trying to change the bashrc file so that the alias changes I need to load in when it reads that file will occur. I have not been able to make that happen. I don't necessarily care about the permissions on this file. I just want it to load up the alias changes when it boots up.

Also, while I have been a member of this group for a while, (2013), I only just now have loaded linux on my system, 100%. Now I MUST get it right. No choice.

thanks for all that have tried to help. I really DO appreciate it.

I am basically a "newbee" with linux, since I have been forced to use Windows, which I hate.

Joe
 
Old 10-08-2018, 03:44 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,523

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
Typically you would add an alias to your users bashrc file i.e. ~/.bashrc.

To load the new alias you need to logout and log back in.
 
Old 10-08-2018, 03:49 PM   #8
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,372

Rep: Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538Reputation: 1538
Quote:
Originally Posted by michaelk View Post
Typically you would add an alias to your users bashrc file i.e. ~/.bashrc.

To load the new alias you need to logout and log back in.
Can't one "reload" the .bashrc by sourcing it?
Code:
source .bashrc
or
. .bashrc
 
Old 10-08-2018, 04:03 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,523

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
That should work...
 
Old 10-09-2018, 01:41 AM   #10
rigor
Member
 
Registered: Sep 2011
Posts: 298

Rep: Reputation: Disabled
N.B. in some distros :
  1. ~/.bashrc sources ~/.alias which if you're going to have any significant number of aliases is a more modular way to approach it.
  2. ~/.bashrc is sourced if you start another terminal window; no need to logout.
 
  


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
Sticky Bit? (ie: chmod 2770 vs chmod 770) JeffC1 Linux - Newbie 7 03-18-2010 08:39 AM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 02:10 PM
chmod 775 to only the directories and chmod 664 to only the files? apachenew Linux - Security 6 09-27-2007 04:26 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 05:23 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 06:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:03 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