UNIX Commands Cheat Sheet

UNIX – Basic GNU Bash (Shell) Commands

  • cd directory name or path

    changes the current directory to that specified. The variable $HOME is the default directory. Typing cd by itself, with nothing following it, takes you to the highest directory; it is usually the same as typing cd $HOME.

  • chmod numbers filename

    chmod 777 filename allows everyone to read, write, and execute the file.

  • exit
  • help command

    type the name of the command you want to understand

  • ln –s pathToBeFound pathEasierToFind

    makes symbolic links (“symlinks”) between files

  • logout
  • ls

    lists all the files in the current directory

  • ls –al filename

    “l” gives you the long listing so that you can see permissions. The r, w, and x specify the read, write, and execute access, respectively;
    “a” show all files, even those that are normally hidden.

  • mkdir newDirectoryName

    makes a new directory with the name specified inside the directory where you currently are located.

  • nano filename

    allows you to edit that file in a pine-like editing environment

  • pwd

    tells you the path for the current directory

  • rm filename

    removes a file

  • rmdir directoryName

    removes a directory