Using Unix Commands to Create and Set Directory Permissions on Polaris
- CSI Staff
- Staff Writer
- Center for Support of Instruction
Category: » Tech-skills-software » Polaris-nova-unix
Each WebTycho faculty member has the option of publishing Course Content (Web pages) to his/her UMUC UNIX account (Polaris). In order to do so, you need to set up a www directory (needs to be done one time only) as well as a subdirectory for the course content materials. This should be done each time you prepare to teach a different online course. e.g.mgmt601, csmn648, tman611, etc.
Note: You need to have created a Polaris account before you can proceed with this tutorial.
The POINT of this tutorial is to make certain you know how to:
- have a www directory in your Polaris account with appropriate permissions set;
- know how to create directories and subdirectories in your Polaris UNIX account, so that you have a place to load your web pages;
- understand a few basic UNIX commands, so that you can manage your UNIX space.
The Least You Need to Know to Get Started Common UNIX Mistakes Part 1
- Press Enter. In UNIX, you always have to press Enter or hit Return before UNIX performs the command you type.
- Capitalization. UNIX is case sensitive. In UNIX, csmn648 and csmn648 are two separate files. Best rule of thumb is to keep everything lower case.
- Spaces and periods. Avoid spaces in your file names. Nothing but trouble. It is best to stick with numbers and letters. And be especially attentive to the spaces and periods in your commands. As far as file names are concerned, the best procedure is to follow the old "eight dot three" DOS rule, where file names have no more than
eight characters followed by a period and a three character
application extension.
- mmonroe.jpg
- tselleck.gif
- basic01a.htm
- imahog.doc
Still want to read more? See When Things Don't Work: Common UNIX Mistakes Part 2
What to Do
1. Connect to Polaris.
Connect to the Polaris
server via PortaPuTTY.
2. At the login prompt,
type your username and hit Enter. Then
type your password and hit Enter.
You should now see Polaris >
3. At the Polaris prompt, type cd
cd is UNIXSpeak for "change
directory." The cd command (with nothing following
it) makes certain that you are in your home directory. Later,
you can type the name of the directory after cd in
order to enter that directory.
Example: cd csmn648 will
put you "inside" the csmn648 directory.
4. At the Polaris prompt, type chmod 711 .
Don't forget to type the period. The period stands for the current directory and is essential. Also, make certain that you insert a space between d and 7, as well as between 1 and the period. The chmod command is UNIXspeak for change file/directory permissions. The chmod 711 . command grants Web users access to your files.
5. At the Polaris prompt, type ls -ld . (Note: That's, the letter L S space dash L D space period)
Make sure the first field in the output of the last command matches the first field (drwx--x--x) of the following line: drwx--x--x [number of files] [userid] [group] [size] [date and time]
6. At the Polaris prompt, type ls
If the screen displays www, then you have already created your www directory and you can go to step 8. If the screen displays the message "www: No such file or directory, continue to step 7.
This ls "list" command
asks UNIX to list the files or directories that are "in" the
directory that you are in. In this case, your
home directory.
7. At the Polaris
prompt, type makewebdir
The makewebdir command tells UNIX to "make a directory a directory called www" and to set the appropriate permissions.
8. At the Polaris prompt, type ls -ld .
Make sure the first field in the output of the last command matches the first field (drwx--x--x) of the following line: drwx--x--x [number of files] [userid] [group] [size] [date and time]
9. At the Polaris
prompt, type cd www
cd www is Unixspeak for "change to the www
directory." Executing this command puts you "in" the
www directory. Now, we are set to make a subdirectory "inside" the
www directory.
10. Type mkdir your
course number (eg., mgmt601) mkdir is the "make
directory" command. You are making a subdirectory
in your www directory. This subdirectory should reflect
the title of your course.
Examples:
mkdir admn601
mkdir csmn618
mkdir tman611
You should put all your course web materials in this subdirectory.
11. Type logout
This terminates the connection. The exit command also works.
What to Do When Things Don't
Work
or
Common UNIX Mistakes Part 2
- Wrong Directory. It is hard to tell which directory or subdirectory you are in. The "list" (ls) and the "change directory" (cd) commands are especially useful here. When you type ls, UNIX will list the files or (sub)directories in the directory you are in. When you type cd with nothing following it, you are automatically taken back to your "home" directory. When you type cd followed by a directory or subdirectory name (eg. cd www), it will take you "inside" that (sub)directory.
- File Permissions. UNIX has a strange set of number commands that set permissions on who has access to your files (who can read, write, execute). Unix recognizes three different categories of people: you, group, and world. In our webpages, we want to give all three categories of users readable and executable permissions, but only you should have write permissions. The first thing to check if your web page does not read is the file permissions on your directory. Type cd www to make certain you are in your www directory. Then type ls -ld to request the permission string. you should see drwxr-xr-x followed by a number, your username, group, and the date. If you get something besides drwxr-xr-x go back and set your permissions again.
- File Extensions. While the best rule of thumb is to stick to the three character extension, Unix does recognize the html four character extension. The second thing to check if your web page does not work is the extension; that is, are you requesting an htm extension when your file was saved as an html?
Basic UNIX Commands
- cd (directory) - Change the current directory
- chmod - Change permission on file/directory
- cp (file1) (file2) - Copy files
- ls - List the files in directory
- man (keyword) - Get help on UNIX commands
- mkdir (directory) - Create directory
- mv (file1) (file2) - Rename a file
- passwd - Change login password
- pwd - Shows the path of the current directory ("present working directory")
- rm (filename) - Remove file(s)
- rmdir (directory) - Remove directories



Comments
No comments posted.Post a Comment / Vote
You must be logged in and be a member of the UMUC community in order to comment.If you are a member of the UMUC community and do not have an account, please register for a FREE one.
If you have a guest account but are Faculty/Staff of UMUC please send an email to the DE Oracle Site Manager so that your guest account can be updated.