How to run a command automatically in Linux Ubuntu?
-
Hi, i recently installed Linux Ubuntu, and its great, but i have a small problem. Every time i start up my laptop, the backlight does not come on automatically. To get it to come on, i have to "blindly" log in to my account, and then press Ctrl + Alt + T, and then type in this command in the terminal - sudo setpci -s 00:02.0 F4.B=00 after i type that in, i have to type in my password. then at last the backlight comes on, and i can see. Is there any way i can get this command to run automatically? i have tried putting the command as a startup application, which did not solve it. Do i need to create a file which i then have to make it run automatically? is there another command i need to use? And will the command be able to run automatically without my password, or do i need to put that into a command as well? If you know how to fix this, please explain fully, as i'm still new to Linux. Thanks for your help.
-
Answer:
You need to add your line to the rc.local startup script: cd /etc #changes directory to /etc where you find rc.local sudo gedit rc.local # elevates you to superuser, opens rc.local using gedit text editor look for the line that says exit 0 then right above it paste your script so it now looks like: sudo setpci -s 00:02.0 F4.B=00 exit 0 save and close rc.local make rc.local executable by typing: sudo chmod +x rc.local and that's it. now when you boot up your computer it will run that line automatically. When you reboot it's a different story, but the source below will explain it for you :) have fun with linux and don't be afraid to explore!
Jason at Yahoo! Answers Visit the source
Other answers
Session Start Up = - https://help.ubuntu.com/community/AddingProgramToSessionStartup
tbshmkr
See if this is any use:-
ray_diator
Related Q & A:
- How To Run A Command In Ubuntu?Best solution by Yahoo! Answers
- How to run a external program in PHP?Best solution by Stack Overflow
- How to play a sound after a command has finished its execution?Best solution by Ask Ubuntu
- How can I run CMD command?Best solution by Super User
- How to run a commercial laundry?Best solution by professional.electrolux.co.uk
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.