Engineering Computing Center

           University of Nevada, Reno




Unix FAQ

  • How do I access my Unix account remotely?
    You can access your Unix account remotely using an SSH protocol 2 client such as PuTTY or SSH Secure Shell Client (Version 3.2), which are available for free download. The login host name will be "unix.ecc.unr.edu".

  • How do I check my Unix Disk Quota?
    Log into a Unix machine. If using the machine locally, open a Terminal and type "quota". If logged in remotely, just type "quota". Be sure to type "exit" and log out. (If logged in remotely, typing "exit" will log you out.)

  • How do I check my ECC Email account on unix?
    You can check your ECC email account on unix by opening a console window and typing either 'pine' or 'mutt' and following on screen directions to check your mail.

  • Common Linux Commands
    lsLists names of files/directories current directory
    ls -alLists full information for files/directories (including hidden files) in current directory
    pineOpens your ECC email account in the Pine mail program
    cdChanges from your current directory to your home directory
    cd [directory name] Changes to named directory [Note: Directory must be within current directory, or you must include the path to the directory.]
    cd .. Go back one directory from current directory
    mv [file1] [file2] Moves contents of file1 into file2 [Note: If file2 already exists in the current directory, it will be overwritten with the contents of file1.]
    mv [dir1] [dir2] Moves contents of dir[ectory]1 into dir[irectory]2 [Note: If dir2 already exists in the current directory, entire directory dir1 will be placed inside dir2. If dir2 does not exist, only the contents of dir1 will be moved into dir2.]
    rm -i [filename] Confirms file to delete and deletes named file
    rm [filename] Deletes named file without confirmation (not recommended)
    rmdir [directory name] Deletes empty directory only (will not delete directory containing files or other directories)
    rm -r [directory name] Recursively deletes ALL contents of named directory and then deletes named directory
    mkdir [directory name] Creates directory with given name within current directory
    quota Lists Unix Disk Quota usage
    passwd Change your ECC Unix and Windows login password
    lpquota Displays your current ECC Print Quota
    lp [filename] Prints named file to default printer
    vi [filename] Opens, or creates in current directery and opens, namedfile in the VIM text editor
    emacs [filename] Opens, or creates in current directery and opens, named file in the XEmacs text editor
    ssh [remote host name] Attempts SSH2 connection with remote host
    scp [arguments] Copies files between hosts (See "man scp" for more information.)
    man [command] Opens manual page on given command
    help [command] Opens help page on given command

  • Common VI Commands
    See Also: vi Commands
    vi [filename]Opens named file in command mode
    Insert Commands
    i, a, I, AChanges to insert mode and puts cursor before cursor, after cursor, at beginning of line, at end of line
    cw Change word (hit ESC when done editing)
    cc Change line
    C Change text up to end of line
    r x Replace character with x
    R text Replace text beginning at cursor
    s Substitute character
    S Substitue entire line
    u Undo insert
    ESC Go back to Command Mode
    Cursor Movement Commands
    CTRL-F, CTRL-B Scroll forward, backward one screen
    CTRL-D, CTRL-U Scroll down, up half a screen
    CTRL-L Refresh (redraw) screen
    :n Moves to line number n
    CTRL-G Displays current line number of cursor
    l, spacebarMove one character forward (right)
    h Move one character backward (left)
    k Move to previous line (up)
    j Move to next line (down)
    nG, :n Move to line number n
    G Move to las line in file
    ^G Display current line number
    w Move one word forward
    b Move one word backward
    e Move to end of word
    ( Move to beginning of current sentence
    ) Move to beginning of next sentence
    { Move to beginning of current paragraph
    } Move to beginning of next paragraph
    [[ Move to beginning of current section
    ]] Move to beginning of next section
    0 Move to beg of current line
    $ Move to end of current line
    +, return Move to beginning of next line
    - Move to beginning of previous line
    n| Column n of current line
    H Move to top line of screen
    M Move to middle line of screen
    L Move to bottom line of screen
    nH Move to n lines after top line
    nL Move to n lines before last line
    ^F Scroll forward
    ^B Scroll backward
    Deletion Commands
    x Delete forward one character
    X Delete backward one character
    5X Delete backward five characters
    dd Delete current line
    ndd Delete n number of lines
    D Delete remainder of line
    dw Delete word
    d} Delete up to next paragraph
    d^ Delete to beginning of line
    d/ pattern Delete until pattern
    dn Repeat d/pattern
    df a Delete until a on current line
    dt a Delete until a on current line butnot including a
    dL Delete up to last line on screen
    dG Delete up to end of file
    p Insert last deleted text after cursor
    P Insert last deleted text before cursor
    u Undo last change
    U Restore current line
    . Repeat last change
    ~ Reverse case
    Copy and Paste Commands
    y Copy current line to new buffer
    yy,Y; nyy,nY Copy current line; Copy n lines
    yw; nyw Copy 1 word; Copy n words
    y/pat Copy until pattern
    yn Repeat y/pat
    y} Copy up to next paragraph
    y^ Copy up to beginning of line
    yfa Copy up to a on current line including a
    yta Copy up to a on current line excluding a
    yl Copy up to last line on screen
    yG Copy up to end of file
    p Paste after cursor. If line copied, paste below cursor
    P Paste before cursor. If line copied paste above cursor
    Searching and Marking Commands
    /text Search forward for text
    ?text Search backward for text
    n Repeat previous search
    N Repeat search in opposite direction
    / Repeat forward search
    ? Repeat backward search
    % Find match of current parenthesis, brace or bracket
    mx Mark current position with character x
    `x Move cursor to mark x
    'x Move to start of line containing x
    `` Return to previous mark
    '' Move to start of line containing previous mark
    Saving and Exiting Commands
    zz Save and quit vi
    :x Save and quit vi
    :wq Save and quit vi
    :w Save file
    :w file Save to file
    :n1,n2wfile Save lines n1 to n2 to new file
    :n1,n2w >> file Save lines n1 to n2 to existing file
    :w! Save to file (overriding protection)
    :w! file Overwrite file
    :w %.new Save file as file.new
    :q Quit vi
    :q! Quit vi discarding edits
    Q Quit vi and invoke ex
    :vi Return to vi after Q command
    :e file2 Edit file2 without leaving vi
    :n Edit next file
    :e! Return to version of current file at time of last write
    :e# Edit alternate file
    % Current filename
    # Alternate filename
    Accessing Multiple Files
    :e file Edit another file, current file becomes alternate
    :e! Restore last saved version of current file
    :e + file Edit at the end of file
    :e+ n file Edit file at line n
    :e # Opens to previous position in alternate file
    :n Edit next file
    :n! Force next file
    :n files Specify new list of files
    ^G Display current file and line number
    :args Display multiple files to be edited
    :rew Rewind list of multiple files to top
    Other Commands
    :sh Create a subshell; Type exit to go back to vi
    :!cmd Run UNIX cmd then return to vi
    !! Repeat last system command
    :so file Read and execute command from file
    :r !cmd Read in output from file after current line
    :r file Read in contents of file after cursor
    J Join two lines
    :j! Join two lines, preserving blank spaces
    << Left shift line
    >> Right shift line
    >} Shift right to end of paragraph
    <% Shift left unitl matching parenthesis, brace or bracket

  • Common Emacs Commands
    Note:
    C- = Control (Ctrl) key
    M- = Meta key, generally the Alt key but can also be the Esc key
    Essential Commands
    C-x,C-fOpen a file, if file doesn't exist then create it
    C-x,C-sSave the file
    C-x,C-wSave to a new file
    C-x,C-cExit XEmacs
    C-x,uUndo last edit
    C-gCancel command
    C-pMove cursor one line up (an alternative to arrow keys
    C-nMove cursor one line down
    C-fMove cursor one character forward
    C-bMove cursor one character back
    C-vScroll up
    M-vScroll down
    C-sSearch for characters
    M-%Search and replace characters
    M-gGo to line number
    DELBackward delete character (an alternative to backspace key)
    C-dForward delete character
    C-x,2Split window horizontally
    C-x,1Unsplit window
    C-hEnter the online help system
    M-x,cmdSearch command cmd
    File Handling Commands
    C-x,C-fOpen file if file doesn't exist then create it
    C-x,C-vOpen another file in the same buffer
    C-x,iInsert file at cursor position
    C-x,C-sSave file
    C-x,C-wSave to a new file
    C-x,C-cExit XEmacs
    C-zSuspend XEmacs
    Cursor Movement Commands
    C-fMove one character forward
    C-bMove one character backward
    C-pMove to previous line
    C-nMove to next line
    M-fMove one word forward
    M-bMove one word backward
    C-aMove to beginning of line
    C-eMove to end of line
    M-aMove backward one sentence
    M-eMove forward one sentence
    M-]Move backward one paragraph
    M-[Move forward one paragaraph
    C-vScroll up
    M-vScroll down
    C-x,>Scroll right
    C-x,<Scroll left
    C-x,[Move backward one page
    C-x,]Move forward one page
    M->Move to end of file
    M-<Move to beginning of file
    M-gGo to line number
    C-lMove cursor at the center of the buffer
    Window Commands
    C-x,2Split window horizontally
    C-x,5Split window vertically
    C-x,1Delete other windows except current one
    C-x,0Delete current window
    C-x,oMove to the other window
    C-x,^Enlarge window vertically
    C-x,}Enlarge window horizontally
    C-x,{Shrink window horizontally
    M-C-vScroll other window
    C-x,4,fFind file in other window
    C-x,4,bSelect buffer in other window
    Deletion Commands
    DELBackward delete one character
    C-dForward delete one character
    M-DELBackward delete one word
    M-dForward delete one word
    C-kDelete from cursor to end of line
    M-kDelete sentence
    C-x,DELDelete previous sentence
    C-yRestore what was deleted
    C-wDelete a marked/highlighted region
    Search Commands
    C-sSearch forward
    C-rSearch backward
    MetaExit a successful search
    C-gCancel search
    DELDelete incorrect character search string
    M-%Search and replace characters
    Buffer Manipulation Commands
    C-x,bSwitch to another buffer
    C-x,C-bList all available buffers
    C-x,kDelete specified buffer
    C-x,sPrompt to save each modified buffer
    Help Commands
    C-hEnter the online help system
    C-h,tEnter the Emacs tutorial
    C-h,iStart the info documentation reader
    C-h,nNews about updates to Emacs
    C-h,C-cEmacs General Public License
    C-h,C-dInformation on ordering Emacs from FSF
    C-h,C-wDescribe the no warranty for Emacs




      Engineering Computing Center - University of Nevada, Reno -