Miscellaneous Commands

Miscellaneous Commands

The commands in this section are here because they didn't seem to fit in anywhere else.

alloc

Displays the amount of dynamic memory acquired, broken down into used and free memory. Along with an argument, alloc shows the number of free and used blocks in each size category. The categories start at size 8 and double at each step. This command's output may vary across system types, since systems other than the VAX may use a different memory allocator.

Example: To display a listing of dynamic memory, use

alloc

built-ins

Prints the names of all built-in commands.

Example: To display a listing of built-in commands, use

builtins

Example: To log out of the current session, type

bye

Logout.

Example:

cd [-p] [-l] [-n|-v] [name]

Change current working directory to either a new directory specified by name or the user's home directory.

Example: To change to the parent of your current working directory, use

cd ..

chdir

A synonym for the cd built-in command.

Example: To make /tmp your current working directory, use

chdir /tmp

echo

[-n] word

Displays each word argument to the shell's standard output.

Example: To display the current value of your PATH environment variable, use

echo $PATH

exit

[expr]

The shell exits either with the value of the specified expr (an expression, as described under Expressions) or, without expr, with the value of the status variable.

Example: To log out of the shell, use

exit

hashstat

The TC shell maintains an internal hash table of paths to executable commands. The idea here is that the hash table is more efficient than performing repeated searches of the directories in the $PATH environment variable. The hashstat command prints a statistics line indicating how effective the internal hash table has been at locating commands (and avoiding exec's). An exec is attempted for each component of the path where the hash function indicates a possible hit and in each component that does not begin with a '/'. Note that on machines without vfork, hashstat displays only the number and size of hash buckets.

Example: To display your hash table usage statistics, use

hashstat

inlib

shared-library

Adds the specified shared library to the current environment.

Example: To add the shared library located in /some/after/market/ library.a to the current environment, type

inlib /some/after/market/library.a

log

Prints the watch shell variable and reports on each user indicated in watch who is logged in, regardless of when they last logged in. See also watchlog.

Example: To display log statistics for the users listed in the $watch shell variable, type

log

login

Terminates the login shell and replaces it with an instance of /bin/ login. Note than by running this command from your shell, you are effectively logging off.

Example: To relogin as someone else, type

login

logout

Terminates a login shell.

Example: To log out, type

logout

ls-F

[-switch ] [file ]

The F option to the system ls command appends special characters (*/=@|) to listed files, indicating which sort of file it is. Functionally equivalent to 'ls -F', but faster:

Symbol

Meaning

/

directory

*

executable

@

symbolic link

|

FIFO

=

socket

Example: To list the files in /tmp with special characters appended to them indicating the file type, use

ls-F

newgrp

[-] group

Change group id. For obvious reasons, this usually involves providing a password.

Example: To change your effective group id to bin, use

newgrp bin

printenv

[name]

Displays the names and values of all environment variables.

Example: To display the current values of your environment variables, type

printenv

rehash

If you add new commands to the directories in your PATH variable while you are logged in, you can use this command to recompute the internal hash table storing the contents of those directories. (See the entry on hashstat for further information.)

Example: To update your shell's internal hash table, use

rehash

rootnode

//nodename

Changes the rootnode to /nodename, so that '/' will be interpreted as '//nodename'.

set

set name

set name=word

set

[[-r]] [[-f||-l]] name=((wordlist))

set name

[index]=word

Sets or displays (no arguments) shell variables. The -r option specifies read-only.

Example: To set your shell's watch variable to the user bob, type

set watch=bob

setenv

[name [value]]

Without arguments, displays the names and values of all environment variables. Given name, sets the environment variable name to value or, without value, to the nul string.

Example: To set the INFORMIXDIR environment variable to /bin/informix,

setenv INFORMIXDIR /bin/informix

source

[-h] name [args ]

Reads and executes commands from the specified file.

Example: To load your aliases from the file .alias, use

source ./.alias

umask

[value]

Sets the file creation mask to the specified value. Value is given in octal. Common values are 002 (all access to owner, read and execute to group, read and execute to other) and 022 (read and execute to group, read and execute to other). See the chmod command entry for more discussion of octal format file permissions.

Example: To set your umask to 022, type

umask 022

unhash

Tells the shell to stop using the internal hash table when looking for executable programs. See also rehash.

Example: To tell the shell to stop using the internal hash table, type

unhash

unset

pattern

Removes all variables whose names match the specified pattern.

Example: To remove the variable from the current environment, type

unsetA

unsetenv

pattern

Removes all environment variables whose names match pattern. 'unsetenv *' thus removes all environment variables. (This is a bad idea.)

Example: To unset your INFORMIXDIR environment variable, type

unsetenv INFORMIXDIR

watchlog

An alternate name for the log built-in command (q.v.). Available only if the shell was so compiled; see the version shell variable.

Example: To display usage statistics on all users listed in the $watch shell variable, type

watchlog

where

command

Reports all known instances of command, including aliases, builtins, and executables in path.

Example: To display all the locatable instances of the smbclient command, type

where smbclient

which

command

Displays the full path to the command that will be executed by the shell after substitutions, path searching, etc. Like the system program which, but better because it is aware of shell built-ins.

Example: To specify which version of kill you will use by default, type

which kill

 



Linux Desk Reference
Linux Desk Reference (2nd Edition)
ISBN: 0130619892
EAN: 2147483647
Year: 2000
Pages: 174
Authors: Scott Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net