Solaris Quick Reference

  1. Telnet, workstation, or console
    1. Log In
      Type your username at the login prompt.
      Type your password at the password prompt.
    2. Change Password
      Type yppasswd. Enter your old password, then enter your new password. You'll be asked to enter the new passwd again to make sure there are no typing errors.
    3. Log Out
      If you are in OpenWindows click the 3rd mouse button over the background, then choose Exit from the Menu.
      Otherwise, type logout.
  2. File System
    1. Create File
      type cat > filename, then text ending with CNTRL-D.
      • See Editing Files for how to use vi and emacs.
    2. Make (or Create) Directory
      Type mkdir directory-name.
    3. Look at File
      Type cat filename
      or more filename.
    4. Print File
      Type lpr filename.
    5. List Files and Directories
      Type
      ls for listing of current directory.
      ls directory-name for listing of another directory.
      ls filename for listing of a single file.
      ls -lt to get a listing reverse sorted by time of last modification
    6. Move or Rename Files and Directories
      Type
      mv source-filename destination-filename to rename a file
      mv source-filename destination-directory to move a file into anoter directory
      mv source-directory destination-directory

        to rename a directory (if destination-directory does NOT exist)
        -or-
        to move the source-directory into the desitantion-directory (if the destination-directory exists).

    7. Copy Files
      Type
      cp source-filename destination-directory to copy a file into another directory
      cp source-filename destination-filename to copy a file into another filename
    8. Remove (or Delete) File
      Type
      rm filename to remove a file
      rmdir directory-name to remove an empty directory
      rm -r directory-name to remove a directoyr and its conteents
    9. Change Working Directory
      Type cd to chande directories to your home directory
      cd directory-name to change directories to another directory
    10. Find Name of Current Directory
      Type pwd
    11. Pathnames
      simple: One filename or directory name to access a local file or directory.
      absolute: List of directory names from the root directory (first /) to
      desired filename or directory name. (pwd list the absolute path.)
      relative: List of directory names from current position to desired
      filename or directory name.
    12. Directory Abbreviation
      ~/ Home directory
      ~username/ Another user's home directory
      . Working directory
      .. Parent of working directory
  3. Commands
    1. Date and Time
      Type date to find out the date and time.
      Type date -u for universal time (Greenwich Mean Time).
    2. Calendar
      Type
      cal year for yearly calendar
      cal month-number year for monthly calendar
    3. Wild Cards
      ? Single character wild card
      * Arbitrary number of characters
    4. Redirecting Output
      System types output of command to file rather than screen, replacing current contents of file, if any.
      Type command-name > filename

      System types output of command to file rather screen, appending to current contents fo file, if any.
      Type command-name >> filename
  4. Search Files
    Type
    grep search-string filename to type out lines containing the string in a specific file
    grep -v search-string filename to type out lines that do NOT containing the string
    command | grep search-string to find the lines containg the sting in the output of command. (example: history | grep history)
  5. Timesavers
    1. Aliases
      To "alias", or abbreviate a command string:
      1. Create a .aliases file in your home directory, if it doesn't already exist.
      2. Edit the dot aliases file. Each alias should have the form:
        alias alias-string command-string
        (examples:
        alias h 'history'
        alias cd.. 'cd ..'
        alias gms '/usr/local/GMS/gms -r /usr/local/GMS/')
      3. The aliases will start to work after you login again
        -or-
        type source ~/.aliases to start using the new aliases now.
  6. History:Command Repetition
    Type
    history to lists the commands you have used in order.
    !! to repeat the entire last command line at any point in the current command line.
    !command-number to repeat the command with command-number from the history list.
    (Type history to find out the command-number. The command-number
    is the number in the left most column.)
    !$ to repeat the last word of the last command line at any point in the currrent command line.
  7. Run Command in Background: Job Control
    To run a command in the background,as opposed to the more common method of running commands in the foreground, type a & after the command line. Then you can type more commands to the command prompt, or even run more commands in the background for simultaneous command execution.
  8. Online Documentation
    Type
    man command-name to see the online Man Pages for a certain command.
    man -k key-word to get a listing of commands that have key-word in their description.
   
   

References:
References & Tools Home --> References --> Solaris Quick Reference

Command references, manuals, quick references, and other information.

Contact Webmaster
Advertising