Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 240 Introduction to UNIX Instructor: Sue Sampson.

Similar presentations


Presentation on theme: "CIS 240 Introduction to UNIX Instructor: Sue Sampson."— Presentation transcript:

1 CIS 240 Introduction to UNIX Instructor: Sue Sampson

2 CIS240 – UNIX File Sharing Five Methods for File Sharing Duplicate Shared files Common login for members of a team Allowing access to a file by setting permissions Assigning a common group to members of a team File sharing via links

3 CIS240 – UNIX File Sharing Links Hard link – pointer to an inode of a file you want to reference Soft (symbolic) link – new file of type link that contains the path name of a file you want to reference

4 CIS240 – UNIX File Sharing Using ln Format to Create a Hard Link : ln [options] existing-file new-file Creates a hard link to an existing file in current directory ln test12.txt test12.hard Format to Create a Soft Link : ln -s existing-file new-file Creates a soft link to an existing file ln -s test12.txt test12.soft

5 CIS240 – UNIX File Sharing Advantages of Hard Links If a file is moved within the same file system, the hard link still points to it Accessing a file is faster using a hard link

6 CIS240 – UNIX File Sharing Drawbacks of Hard Links Hard links cannot be established between files on different file systems Only a superuser can create a hard link to a directory Some applications will copy the contents of an existing file to a new file, then rename the new file as the old one. Since hard links point to inodes, the link is broken by this process.

7 CIS240 – UNIX File Sharing Advantages of Soft Links Because the soft link contains a path to the file, the link will still point to a new file with an existing name. You can have a link that points to another file system You do not need to be logged in as root to create soft links

8 CIS240 – UNIX File Sharing Drawbacks of Soft Links A new file has to be created for each link The paths have to be updated when the files they reference are moved It takes longer to access a file via a soft link because you have to open the soft link, read the path, then open the file

9 CIS240 – UNIX File Sharing Sharing Files Using Links Create a directory containing links to files you want to share Set the permissions to allow access to those files

10 CIS240 – UNIX File Sharing File Transfer Protocol (ftp) UNIX TCP/IP utility used to transfer a file or set of files from one computer to another Format: ftp Example: ftp academic1.bellevue.edu

11 CIS240 – UNIX File Sharing Requirements for Use ftp client software on the local computer ftp server software on the remote computer A network connection between the two computers A user account on each computer Read permission on the source file or files Write permission on the destination directory

12 CIS240 – UNIX File Sharing Summary of Useful ftp Commands help Display a summary of ftp commands asciiSet the transfer mode to ASCII binarySelect the transfer mode to binary cdChange directory open Open a connection with closeClose connection without exiting ftp get Move a file from to put Move a file from to byeExit the ftp client

13 CIS240 – UNIX File Sharing Contexts Think before you execute commands While you are in ftp, you are not executing at the UNIX command line Entering ls creates a list of the remote directory Entering !ls creates a list of the local directory Entering lcd changes path of local directory Entering cd changes path of remote directory If you are transferring program files (executables) you must switch to binary mode or the files will not transfer correctly

14 CIS240 – UNIX File Systems mount Adds a new file system to the directory Allows other devices (floppy/cd rom/ etc) to be accessed by linux Allows file systems to be mounted from other computers using the Network File System Note: You must create the filesystem before you can mount it mke2fs /dev/fd0 ( Create a second extended (ext2) filesystem – a floppy drive -- in the device directory. Done for you in RH9.) mount dev/fd0 (binds the current floppy to the filesystem.)

15 CIS240 – UNIX File Systems umount Unmounting removes the file system from your file structure. It is done when you intend to remove the media containing the file system from the computer. Note: You must unmount a file system before you remove the floppy from the device. Failure to do so can render the files on the floppy inaccessible umount /dev/fd0 (unmounts the filesystem)


Download ppt "CIS 240 Introduction to UNIX Instructor: Sue Sampson."

Similar presentations


Ads by Google