Reaching Others University at Buffalo - The State University of New York
Skip to Content

Basic UNIX

Short list of basic UNIX commands and the CCR reference card.

The CCR Linux command reference card has a list of commonly used Unix commands with examples.

The CCR cluster is accessed through a command line interface. 

There are a few basic UNIX commands that are helpful in getting started on the cluster. 

  • Show pathname of current directory: pwd
  • List files: ls
  • Make a directory: mkdir directory-name
  • Change directory: cd directory-name
    • Change directory back to home directory: cd
  • Copy a file: cp old-filename new-filename
  • View a file:
    • cat filename
    • more filename
    • less filename
  • Edit a file:
    • emacs filename
    • vi filename
  • Delete a file: rm filename
    • Delete a directory (recursively): rm -R directory-name
      • All files and subdirectories are deleted
  • Move a file: mv old-filename new-filename
  • Change permissions:
    • Arguments to chmod command: ugo+-rwx
      • where ugo are user, group and other; rwx are read, write and execute
    • Add execute permission for yourself: chmod u+x filename
    • Remove read, write and execute for group and other from a directory and its contents:
      chmod -R go-rwx directory-name

Man Pages

The man command will give usage information for any UNIX command.

Press space bar or enter to page through man page.

Type q to quit.

Example: 

[cdc@u2:~]$ man ls

LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents

SYNOPSIS
       ls [OPTION]... [FILE]...

DESCRIPTION
       List  information  about  the FILEs (the current directory by default).
       Sort entries alphabetically if none of -cftuvSUX nor --sort.      

       Mandatory arguments to long options are  mandatory  for  short  options
       too.

       -a, --all
              do not ignore entries starting with .
...

Module commands for applications

Modules are used to set the necessary paths and variables for an application.