Easy Alias

           Created by Bismoy Ghosh.



Easy Alias:

First time you use 
cd directory
chmod +x bashscript.sh
bash bashscript.sh


To use any repo . And after that need to run 
cd directory
bash bashscript.sh

Why?????

If I tell you you can use a short comand to execute all those process??? It will be more funable right?? But it is too risky sometime . But I am with you right?? So,let's began..


Suppose you had cloned a git 
The repo like :

web

Under that many files included ,but an executable file exist. Suppose that was python file will run with:

python ,python3 

The python file name in website.py
It will run with :

python website.py 
or 
python3 website.py

Everytime you need to run:
cd web 
python website.py

Why??if I say after opening terminal you just type web and the file will execute?? Isn't 
It easy?? So let's began, follow my steps..

Only Do:

open terminal 
type:
nano ~/.bashrc

Add these line to the script:
export PATH=$HOME:$PATH

press Ctrl+x
Then Ctrl+y
Then hit Enter 

Now run 
source ~/.bashrc


This will not use for every repo, just do it once and use forever. There are many method to do that you can use alias method ,but the bash file is very important so don't open that everytime.if a single mistake your terminal system stops working properly .

Now next things you need to do for every repo
That is ....
You need to run 
cd web
python website.py

Just create a file  Website 
type:
nano website

Then add :
cd web
python website.py

Press Ctrl+x
Then Ctrl+y
Then hit Enter 
Run chmod +x *

Then everytime  you type website it will run all those command under the file .

If your executeable file is bash 
Use bash website.sh instead of python website.py
Now here you go .....


Comments

Popular posts from this blog

Fixing apt and dpkg Errors in Ubuntu/Debian

Python Web Scanner(Easy to USE)