Use SSH to View and Edit Files on ArtSci

Topics:

A number of important file functions can be performed at the UNIX command line. If you creating a web page, for example, you may need to view your existing files, move between directories, make new directories, move files, and delete files. You can accomplish all these from the command line. In the directions below, common UNIX commands will be shown in bold text.

Getting to a UNIX Command Prompt

To get a UNIX prompt, you can log in to the artsci server using SSH Secure Shell or similar program. Your domain will be artsci.wustl.edu. Your username and password should be the same as the ones you use to log into artsci webmail.

Viewing and Navigating Files and Directories

Once you have a command prompt, you can view the contents of your account by entering ls as demonstrated below.

A number of the files and directories will be related to email, and you shouldn't touch unless you really know what you're doing. All the files that can be accessed over the web (web pages, documents, images) will be located in the public_html directory. To move into your public_html directory, type cd public_html at the command line. To view the files in your public_html directory, again type ls. To view more details about the files and directories, including permissions, type ls -l.

'D' indicates a directory. The permissions are the 9 characters after that. 'R' stands for 'read', 'w' stands for 'write', and 'x' stands for execute. The first 3 letters are for the owner. The account holder is generally the owner on files and directories within their account. So in the example above, 'jess' the owner has 'read' and 'write' privelages on both the 'docs' directory and the 'index.html' file. To move or edit a file, you must have write privledges on it. The middle 3 letters indicate the group permissions. The last 3 letters indicate the permissions anyone outside your group has. For a file to be accessible over the web, usually 'other' needs read privelages. See 'Change the Permissions on a Web Page' for more information about changing file permissions and the chmod command.

Account Management

Students have a limited account size, so they may find it useful to check how much space they are using. To check your total space usage, enter checkart at the command line. You may also check the size of your email specifically by following the directions here.

Anyone may change their email account password at the command line as well. To change your password, enter passwd and follow the on-screen directions. For more information, look here.

Moving, Copying, and Deleting Files

Again, you'll need write permissions on anything you move or edit. Before you can move a file, you'll need to have a directory to move it to. To create a new directory, use the mkdir command followed by the new directory name as shown below.

To move a file, use the mv command. For example, to move the index.html file displayed above into the new directory, you would enter mv index.html new. To copy the file instead of moving it, replace mv with cp.

To delete a file, use rm followed by the file name of the file you wish to delete.