Custom Command
Hi guys~!
Today I got some issue on Ubuntu16.04.
Although the Ubuntu is linux base, in ubuntu, we can't use root to login.
Or u have to spend time to figure it out.
So, the issue I met is that I tried to link serial port by some IDE, such as Qt,
but the ttyUSB or ttyS0 ports are set as 550 permission.
To use the port correctly u have to use root or sudo, but u can't run the Qt as root directly
like Windows, in which u just right clicked and run as Administrator.
Things u have to do is :
cd /urpath/Qt/Tolls/QtCreator/bin
sudo ./qtcreator
So... the things I gonna teach u is ... how to write a custom command ~~
LOL, Sorry for tell a long story before the tutorial ahh.
First of all,
write the command u wanna use in txt or .sh whatever u want
command :
cd /urpath/Qt/Tolls/QtCreator/bin
sudo ./qtcreator
A common way to handle this is to use /bin directory,
mkdir ~/bin
put ur script in the folder
mv yourfile ~/bin
make sure u can execute it
chmod +x ~/bin/yourfile
Finally add this to the bottom of your ~/.bashrc file
export PATH=$PATH:~/bin
Okay, now you can use yourfile command in terminal directly~!!!
Cheers~!
THE END
Provide |
Comments
Post a Comment