Basic Unix Commands

Basic Commands

Once you connect to tombstone you will need these basic commands to get started:

pico Pico is a simple text editor. You can use pico for editing Stata do files.
ls Show a list of files in your current directory.
stata Run Stata for Unix. Unix Stata is fully compatible with the Windows and Mac versions of Stata available in the clusters.
quota -v Reports how much space you have left on your Arizona account - this is the same as the amount of space you have on your H: drive.
logout This will log you off the machine when you are done.

Working with Directories

Files on UNIX are stored in directories. These are much like the directories on a PC or folders on a Mac. When you log on to your UNIX account, you are placed in your "home directory." Within your home directory you can have other directories, called "sub-directories." These sub-directories can also have other directories within them.

Directories make organizing your files easy. You can put all of your data files in one directory and all your programs in another, or, you can have a directory for each class you are taking. The term "path" is often used to refer to directories and their subdirectories.

pwd
The command pwd will tell you where you are witihin a directory structure.

cd [directory]

Use the cd command to change into the specified directory. The command cd without specifying any directories will bring you back to your home directory, and cd .. will bring you back up to the next highest directory. For example, the following command:

cd soc453

will make soc453 your current or working directory. If you give the ls command, you will see a list of files in that directory. Any new files you create will, by default, be created in that directory. If you issue the command:

cd ..

you will move up one level in the directory structure, to what is called the parent directory. In this example, the parent directory would be your home directory. You can return to your home directory at any time by issuing the cd command with no operands:

cd

mkdir [directory]

The command mkdir will make (create) the specified directory. For example, issue the following command to make a directory named thesis within the current directory.

mkdir thesis

Or issue the following command to make a subdirectory named programs with the directory soc453:

mkdir soc453/programs

rmdir [directory]

The command rmdir will remove (erase) the specified directory. The directory must be empty of files or other subdirectories before it can be removed.

Page tags: commands unix
page_revision: 0, last_edited: 1193769045|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License