Other Execute On the Command Line

Now that I've got FreeBSD up and running. I found a DTE I like, but I want to execute programs from the command line. Where are the executable files for Chromium, libreoffce...etc so I don't have to rely on the DTE. This is one of the main reasons I want to use FreeBSD. I miss my old DOS days when I could just type the command, and all goes well.
 
If you know the name of an executable, but don't know where it lies, use which:
Code:
% which chrome
/usr/local/bin/chrome
 
Just like MS-DOS, if the folders containing the programs are in the PATH variable you can just type their name in the command line to execute them.

The folders /bin /usr/bin /usr/local/bin are already in PATH

For example (depending on your browser), try:

Code:
$ firefox
$ chromium
$ chrome

check out echo $PATH
 
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:
  1. First you need to build database: /usr/libexec/locate.updatedb
  2. Then you can easily search for file name: locate cat
 
Now that I've got FreeBSD up and running. I found a DTE I like, but I want to execute programs from the command line. Where are the executable files for Chromium, libreoffce...etc so I don't have to rely on the DTE.

Out of curiosity, what does "DTE" stand for. I haven't heard it before. Associating with computers, the closest a web search points to is "Data terminal equipment". If that's the case I can't make the association relying to it for executing programs.


To the question, besides what the others have listed how to proceed, you might want to know about the pkg info -l <package name> ( pkg-info(8) ) command. It lists all files installed by a package. You can in addition grep(1) for specific files of that package:

pkg info -l <package name> | grep local/bin

This is helpful when some executables have alternative ones or more besides the main one, or you are looking for the programs configuration files, etc. You mentioned libreoffice, executing libreoffice will return ( at least on my system, 12.1-R, latest package repository, v. 7.0.0.3 ) an error:

Code:
... libreoffice -> ../lib/libreoffice/program: No such file or directory

Whereas loffice ( shown in the package files list ) will open the suite. You can find in the list more libreoffice executables to start the programs one by one instead from the suite.
 
Now that I've got FreeBSD up and running. I found a DTE I like, but I want to execute programs from the command line. Where are the executable files for Chromium, libreoffce...etc so I don't have to rely on the DTE. This is one of the main reasons I want to use FreeBSD. I miss my old DOS days when I could just type the command, and all goes well.
With modern system, you should not do so. Just launch the program from their launchers, on desktop or menu. Starting it from the terminal has no benefit other for debug it, otherwise it just printed a bunch of error messages that we could safety ignore. Please note that, when you run a graphical app from the terminal, you will not back to the prompt until the app is closed. You will need a bunch of terminal tabs. I think there is no reasons to do so. What is the point of using a desktop environment when you have to launch all of your programs from the terminal?
 
Back
Top