What is Linux’s equivalent of C:Program Files ?

(also known as C:progra~1 in older Windowses)

Short answer: /bin or /usr/bin.

Longer answer: It depends on the distro (Ubuntu, Slack, Arch, Mint, Puppy, etc) and on what kind of program. You could think of these directories as decreasing from user land toward the bare-metal computer level. (Roughly / sort-of / not exactly.)

  • /opt/ (programs you download)
  • /bin/ (netstat, uname, wc, zcat, rm, rmdir, gzip, head, tail, last, ln, ls, kill, gawk, sleep, sort, tar, touch, vi, cat, chmod, sh, bzip2, bash, dmesg)
  • /usr/bin/ (lpr, xsane, zipgrep, xrandr, xsane, less, leafpad, ldd, xinit, dpkg, ssh, sudo, sftp, dvipdf, evince)
  • /usr/sbin/ (gtkdialog, parted, wpa_supplicant, ethtool, nscd, grub, dhcpd, httpd, cupsd, alsaconf)
  • /sbin/ ( fsck, fdisk, mount, swapon, ifup, sysctl, lspci)

You should preferably store programs you download in:

  • /opt/.

(for optional) and add /opt/ or /opt/bin/ to your $PATH with

  • echo $PATH
  • export PATH=$PATH:/opt
  • echo $PATH

(if that gives you an error you may need to give yourself access with chown or chmod. For example chown isomorphismes /opt/ or chmod -R a+rw /opt/.

If you want to find where some command or program you use is located, use which.

# which ls

# which grep

# which top

# which java

# which ghci

# which ruby

# which python

# which perl

# which jwm

# which awesomewm

# which xinit

# which latex

# which pdflatex

# which dvips

# which sage

# which ack-grep

# which ack

# which gdb

# which epdfview

# which dpaste

# which lein

# which less

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s