Useful UNIX Commands

When working at the ITECS Help Desk, some competence with UNIX shell is necessary at times. This article lists a few of the basic UNIX commands that may be helpful.

man commandname– This is used to list the manual pages for specific commands available through the terminal window. These pages contain documentation on the UNIX commands, including information such as how they are executed, associated options, and what the command does. Use the ‘man’ command when you know the command name, but you are unsure of the functionality of the command.

screen-shot-2016-09-27-at-4-26-31-pm\[Above: ‘man ls’ command.]

pwd– The print-working-directory command is used to determine your location in the file system. Executing this command will result in an output that gives you the current (absolute) pathname of your location.

cd– The change directory command is used to navigate through the file tree. It changes your current location to a  location specified by the pathname that you input.

ls– The list directory command confirms that a file that you have requested has moved to the location that you wanted. There are also a number of dash options that can be used with ls commands:
-l lists all the contents in long format
-a lists ALL files, including .net and hidden files
-al lists ALL files in long format

mkdir– The make directory command creates a directory for storing and organizing other files. For example, to create a directory called Classes in your home directory, you would first be sure to start off in your home directory and then type: mkdir Classes

rm filename– The remove command removes unwanted files and directories from your computer. Removed files are permanently deleted. The rm command will follow-up by asking if you are sure that you want to remove a file- type “y” if you want to remove it and “n” if you do not.

quota– The quota command is used to see how much disk space you are using and how much is free, given that there is a limited amount of space available on your Eos/Unity account.
The Volume Name is the volume that your account space is located in.
Quota tells you how many kilobytes of disk space is reserved for your account.
Used tells you how much of that space you have used.
% Used is the ratio of ‘used’ to ‘quota’ given in a percentage.
Partition information refers to the overall partition that your files are located on.

AFS allows users to store and share files on the University system, as well as controls access to these files and maintains security. It may be convenient, when working on group projects, to share files through your AFS space. To share these files, you can grant others access to certain directories in your space by changing the Access Control List (ACL). The commands relating to this are as follows:

fs– The fs command, when combined with certain command names and options, allows you to modify the access rights of your AFS space.
     fs la– allows you to see the access information in your current directory.
fs la pathname– allows you to see access in a different directory.
fs sa– allows you to modify the access settings of a particular directory. This command requires you to specify a pathname for the access, the unityid of the person you are granting access to, and the type of access.

For the above command, access types that you can grant to others can be any combination of l, r, i, d, w, k, and a.

  • l – look access only allows users to see the files that are in the directory
  • r – read access allows users to read, view, or copy file contents, users must also have look access for this to work
  • i – insert access allows users to move files or create new ones
  • d – delete access allows users to remove files
  • w – write access allows users to write files, and requires read, look, and insert access as well
  • k – lock access allows users to lock others out of a directory. Do not lock yourself out of your own space.
  • a – admin access gives users admin rights to your directory. They will be able to assign access for others to that directory.
  • all – all access grants users l, r, i, d, w, k, and a access
  • none – removes all accesses assigned to the user

For additional useful UNIX commands, view the E115 textbook.

Leave a Comment

You must be logged in to post a comment.

Back to Top