I miss my old DOS days when I could just type the command, and all goes well.
DOS was great but Microsoft Killed it!
I'm just talking about
sh(1). Program files must have their executable bit set to run. For example if you have a file named
foobar you have do this before running program:
chmod u+x foobar
Look at
~/.profile. there's a
PATH=...
. if a directory is presented in this variable then just type the name of program:
foobar
If you are in a directory e.g.
~/foo and there's a executable file name e.g.
bar, then: type this run the program
./foobar
.
Most of the FreeBSD programs are reside in these directory (directory is the correct name. Folder is wrong, IM(correct)O)
/bin : user utilities (single/multi user aka always available)
/sbin : admin utilities (single/multi user aka always available
/usr/bin : user utilities (multi user)
/usr/sbin : admin utilities (multi user)
You can always run them, if these directories are available in mentioned
PATH
in
~/.profile.
Read the
hier(7)
Some useful commands:
Locate program:
whereis programName
Find filename:
locate filename
Locate a program file in the path:
which program
[EDIT]: More examples:
Find cat:
whereis cat
Search for binary cat:
whereis -b cat
Your path:
echo $PATH
Full path name of a command:
type cat
I don't know exact name of cammand:
apropos ca
Show me command alias:
alias
Absolute command path:
which cat
What's that file:
file /bin/cat
.*** Find filenames in db:
- First you need to build database:
/usr/libexec/locate.updatedb
- Then you can easily search for file name:
locate cat