For the occasional Unix/Linux user

While you can certainly Google for how to use a particular Unix command (or resort to the man page), collected here are commands I, an intermediate Unix user, find myself employing frequently and/or have difficulty remembering:

Networking:

ifconfigSort of like ipconfig command on Windows.  Note [up|down] options (like renew|release)
ssh -L 1389:localhost:389 <id on remote server>@<remote server>“Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side”.  For example, to set up port 1389 (arbitrary) on localhost to forward, over a secure channel, to non-SSL LDAP port on remote server (in case sys admin does not want to open up firewall)

Miscellaneous:

find . -name libsvnjavahl-1.soFrom current folder, search recursively in sub-folders to find file with name libsvnjavahl-1.so
init 6Restart computer (may require sudo)
envDisplay environment variables
zgrepSearch possibly compressed files for a regular
expression
grep -r "svn:ignore" .Look recursively from the current directory for files with the string "svn:ignore"
moreOpen a file in read-only mode, e.g. a log file.  Shift + G brings you to the end of the file.  "b" scrolls backwards, hitting the spacebar scrolls forward.


Not a specific command, but important is the shell tool reverse-i-search, which allows you to search through and re-execute previously entered commands.  This is much easier than history and then !<number in history>

A lot of UNIX installations in the city that I work in are AIX because of heavy IBM sales.  Rather than the more intuitive bash shell, the Korn shell is enabled.  For speed, it is important to understand how to execute previous commands, or edit and execute previous commands.












No comments: