I'm a web developer. When I want to start working, always i'm executing some command on terminal. For example:
sudo service apache2 start
sudo service mysql start
sublime
For speed up this process, I create a .sh
file which contain these commands.
Now, when I want to start working, I'm just executing this .sh file and all services (mysql, apache2 etc.) starting.
Is it possible to create a custom command for this? For example if I type sudo start-working
to terminal, it will execute these commands
source ~/.bashrc
or. ~/.bashrc
commands to apply the changes. – B Faley Sep 02 '12 at 07:35Is there a way to include all subdirectories that you create in ~/bin so that you don't have to include multiple export lines in .bashrc?
I tried
– Kevin Wyman Jan 10 '13 at 15:09export PATH=$PATH:~/bin/*
but that didn't return the desired results.~/.profile
already adds~/bin
to PATH, so appending it in~/.bashrc
in addition will pointlessly add it twice or more. – geirha May 16 '13 at 19:53echo "export PATH=\$PATH:~/bin" >> ~/.bashrc
to add the path export.tail -n 10 ~/.bashrc
to confirm it worked. – Reed Dec 04 '19 at 02:48mkdir ~/bin; echo "echo \"bin directory created\";date;" >> ~/bin/user_test; chmod -R +x ~/bin; echo "export PATH=\$PATH:~/bin" >> ~/.bashrc; tail -n 10 ~/.bashrc; source ~/.bashrc; user_test;
should do all of it. – Reed Dec 04 '19 at 02:49