# How to make a custom command (shortcut) ,set default path and more



## BSDN00b (Aug 14, 2012)

Hello,

I would like to know how can I make a custom command for FreeBSD 8.2?
For example: I need to type : */usr/cst/no* then *sh open.sh*.
1. how can I make a simple command for executing the file from that folder? for example : start command will execute the open.sh from /no/ folder.
2.How to set a default path when I open FreeBSD?
3.How to learn FreeBSD? I want to learn and understand the FreeBSD system, creating scripts and so on..

Thanks


----------



## SirDice (Aug 15, 2012)

BSDN00b said:
			
		

> I would like to know how can I make a custom command for FreeBSD 8.2?


FreeBSD 8.2 went End-of-Life at the end of last month. Update to 8.3.



> For example: I need to type : */usr/cst/no* then *sh open.sh*.
> 1. how can I make a simple command for executing the file from that folder? for example : start command will execute the open.sh from /no/ folder.



For tcsh(1):
[cmd=]alias mycommand (cd /usr/cst/no && sh ./open.sh)[/cmd]



> 2.How to set a default path when I open FreeBSD?


Edit your ~/.cshrc. Look for a line:

```
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
```
This sets your path.


----------



## fbsd1 (Aug 21, 2012)

As you see at the end of the path command above is $HOME/bin. What this means is if you `$ mkdir bin` from your user's home dir, then any script you place in the bin directory will exec when you enter it on the command line. So create your self scripts containing any combination of commands you want, save to your /home/accountname/bin, rehash and then enter script on command line and it will run.


----------

