130 likes | 253 Views
Getting started on the Unix service. Zahid Aziz October 2009. Objectives. By the end of the session, participants will: be able to log in to, and off from, the Unix service have an understanding of the Unix filestore be able to move around the filestore, and create, modify and delete files
E N D
Getting started on the Unix service Zahid Aziz October 2009
Objectives By the end of the session, participants will: • be able to log in to, and off from, the Unix service • have an understanding of the Unix filestore • be able to move around the filestore, and create, modify and delete files • have an understanding of command options • Have an understanding of file permissions
Ssh program —provides a text-based interface to Unix • Text-based means Unix commands have to be typed in • Need to know Unix commands and how to issue them • Can access Unix host from anywhere over the Internet • Programs with a graphical interface can be run on Unix, if an “X-server” is running on the PC
Exceed Program • The Exceed program runs an “X-server” on the PC, allowing programs running on the Unix host to produce a graphical interface on the PC. ______________________________________ • On IS Computer Room PCs, SSH and Exceed are available under UoN Software. • On your office/own PC, it is preferable to install them locally (see the Software Library)
/ (root) /usr /opt /home /... /home/pcxstudent /home/eczstaff /home/pcxstudent/bin /home/pcxstudent/public_html /home/pcxstudent/dir1 Unix filestore
Basic commands • passwd change password • pwd show current working directory • ls list contents of directory • ls -l -l option for longer listing • pico editor to create text file • cp copy file • mv move (rename) file • rm remove (delete) file • mkdir make directory • cd change current directory
File permissions • Types of permission: r, w, x • Category of user: user, group, other, all • -l option of ls command to display permissions • command chmod to change permissions
Displaying file permissions • ls-l shows file and directory permissions as well as other information: -rw------- 1 cczstaff cc 25 Mar 8 14:47 myfile2 drwx------ 2 cczstaff cc 8192 Mar 8 14:47 public_html • The first character indicates whether it is a file (-) or a directory (d) • Permissions shown by the next 9 characters in 3 groups of 3: • Characters 2, 3 and 4 are the permissions for the user • Characters 5, 6 and 7 are the permissions for the group • Characters 8, 9 and 10 are the permissions for others • Within each group of three, the permissions are: • rindicating readpermission or – indicatingnoread permission. • w indicating writepermission or – indicatingnowrite permission. • xindicating executepermission or – indicatingnoexecute permission
Changing file permissions • Users are specified as: • u for owner • g for owner’s group • o for others • a for all • Permissions are specified as: • r for read access • w for write access • x for execute access • Permissions are added or removed from users with = to set + to add - to remove e.g. chmod o=rx myfile2 (set read & execute access for others) chmod o-x myfile2 (remove others’ execute access)
Selecting groups of files by pattern matching • The * character is used to define a pattern for selecting files and folders whose names match that pattern • b* matches all names beginning with b • *.txt matches all names ending with .txt • Use the echo command to display list of matched names • Example of command: cp *.txt green • This copies all files with names ending in .txt from current folder to a sub-folder called green
Copying files between Unix host and PC • This is done by running an FTP program on the PC end, e.g. SSH FTP Client. • Launch FTP and login to Unix host. • Shows two windows, one with PC filestore and the other with Unix filestore. • Files and folders can be “dragged and dropped” or copied across from one to the other.
Help • Unixmancommand • student-IT-helpline@nottingham.ac.uk ext 16677 staff-IT-helpline@nottingham.ac.uk ext 16677 • Getting more out of Unix training sessions
Objectives achieved? • Can you log in to, and off from, the Unix service? • Do you have an understanding of the Unix filestore? • Can you move around the filestore, and create, modify and delete files? • Do you have an understanding of command options? • Do you have an understanding of file permissions?