.. include:: ../header.txt .. _misc: Miscellaneous Other Commands =============================== .. _whoami: :command:`whoami` ------------------- :title:`Linux for Programmers and Users`, Section 4.10 .. index:: whoami .. program:: whoami .. describe:: whoami The purpose of this curious command is just to report the user's login name. It is useful for shell script programming. Other commands that do a similar task are :command:`id` and ``echo $USER``. The :command:`id` is used more for informational purposes and is not as useful as :command:`whoami` in a shell script. The output of the :command:`whoami` command is slightly different from :envvar:`$USER` because :command:`whoami` outputs the username that the user is working under, whereas :envvar:`$USER` outputs the username that was used to login. For example, if the user logged in as `john` and :command:`su` into `root`, :command:`whoami` displays `root` and ``echo $USER`` displays `john`. This is because the :ref:`su` command does not invoke a login shell by default. .. seealso:: :ref:`who` .. _su: :command:`su` --------------- :title:`Linux for Programmers and Users`, Section 4.11 .. index:: su, sudo .. program:: su .. describe:: su run a shell with substitute user and group IDs SYNOPSIS :command:`su` [-] [USER] .. option:: -, -l, --login make the shell a login shell If the USER name is left off, attempt to become root. Unix system administrators seldom login as root. Rather, they usually login to the system as themselves and then use :option:`su -` or :command:`sudo` to gain superuser (root) privileges. The root user may :command:`su` to other user accounts without typing a password. Other users must always enter the correct password when using :command:`su`. .. _ul: :command:`ul` --------------- :title:`Linux for Programmers and Users`, Section 4.12.4 .. index:: ul .. program:: ul .. describe:: ul Remove or transform underline characters so that they display correctly. SYNOPSIS :command:`ul` [-t terminal] [FILE ...] .. option -t terminal Overrides the terminal type specified in the environment with *terminal*. A commonly used value for *terminal* is `dumb`, produces the simplest output. See :ref:`col` below for an explanation of when you might use :command:`ul`. .. _col: :command:`col` --------------- .. index:: col .. program:: col .. describe:: col filter reverse line feeds from input SYNOPSIS :command:`col` [-bx] .. option:: -b Do not output any backspaces, printing only the last character written to each column position. .. option:: -x Output multiple spaces instead of tabs. .. note:: :command:`col` only reads from standard input (usually from a pipe). Manual pages produced with the :ref:`man` command use a very old text formatting system called :command:`nroff`. To produce attractive display with bold text, colored and underlined text on simple terminals, :command:`nroff` uses special characters such as reverse line feeds, half returns and subscripts. :command:`col` and :command:`ul` may be used to strip out such characters so that manual page documentation might be included in other documents. In most cases, :command:`col` alone will do the trick, but occasionally :command:`ul` is also needed. ``man ls | col -xb > ls_doc.txt`` If a command line similar to above does not solve the problem, try: ``man ls | col -xb | ul -tdumb > ls_doc.txt`` .. _od: :command:`od` --------------- :title:`Linux for Programmers and Users`, Section 4.13 .. index:: od .. program:: od .. describe:: od A debugging utility that will display non-text data in a readable form. The default format of the data is octal, but it may changed. See the textbook for details and examples. .. _mount: .. _umount: :command:`mount` ----------------- :title:`Linux for Programmers and Users`, Section 4.14 .. index:: mount, umount .. program:: mount .. describe:: mount and umount The superuser may use these commands to add or remove a drive to / from the file-system. It may be possible (depending on the system configuration) for regular users to :command:`mount` or :command:`umount` removable drives. Users may use :command:`mount` to display the drives that are currently mounted. (See also :command:`df`) .. _time: :command:`time` ----------------- :title:`Linux for Programmers and Users`, Section 4.15 .. index:: time .. program:: time .. describe:: time This is a debugging utility that reports timing information related to the running of a program. This can give hints about what might be wrong with a command that takes a longer time to complete than it should.