Archive for October, 2007

Disney web site - CHAPTER 12 MANAGING YOUR FILES 3. You ll

Thursday, October 11th, 2007

CHAPTER 12 MANAGING YOUR FILES 3. You ll be asked to type your password, so do so. 4. In the Gedit window, scroll to the bottom of the file and add the following line (on a completely new line of its own): /dev/hda1 /media/windows_ntfs ntfs nls=utf8,umask=0222 0 0 Type this exactly as it is written. You need to put two spaces between each element on the line. This step assumes that the Windows partition is the first on your hard disk. If you know it to be the second partition, change /dev/hda1 to read /dev/hda2. But for most users who installed Ubuntu onto a hard disk that already contained Windows, the Windows partition will be /dev/hda1. Following this, whenever you reboot your computer, the Windows partition should be available via an icon on the desktop and by clicking Places . Computer. Any files you copy from the NTFS partition will be read-only. To change this, right-click the file after you ve copied it across, select Properties, click the Permissions tab, and put a check in the Write box on the Owner line. Accessing Networked Files The easiest way to access servers or shared folders on Windows workstations or servers over a network is to click Places . Network Servers. This will start Nautilus and attempt to search for Windows machines on your local network, just like Network Neighborhood and My Network Places on the various versions of Windows. However, if you ve ever used either of these services under Windows, you might also know how unreliable they can be some computers simply don t appear in the list, others appear eventually after a wait, and others appear but then prove to be mysteriously inaccessible. A far quicker and reliable method of accessing a Windows machine is to open a Nautilus file browser window (Places . Home), and then click Go . Location. In the box, type the following: smb://Windows computer’s IP address/ As you can see, you ll need to know the IP address of the Windows computer. Ask your system administrator or the person in charge of that machine for this address. You may also be prompted to enter a username and/or password to access the shared folder, as shown in Figure 12-8. Note If you re accessing a Windows 95, 98, or Me shared folder, only password protection will have been set (these versions of Windows are unable to specify a username). However, when prompted by Nautilus, you still need to type something into the Username box to gain access anything will do, as long as the password is correct. You cannot leave the Username box blank.

194 CHAPTER 12 MANAGING YOUR FILES Figure (Sex offenders web site)

Wednesday, October 10th, 2007

194 CHAPTER 12 MANAGING YOUR FILES Figure 12-7. You can mount any partition, including those belonging to Windows, using the Disks Manager tool. The Disks Manager program works for temporary access to your Windows files. If you want to make the mount of your NTFS partition permanent so it appears automatically every time you boot up, you must create a permanent mount point and also edit the /etc/fstab file. (The fstab file contains details of all your regular mounts and is discussed in Chapter 15.) However, before editing it, you ll need to create a folder that will act as the mount point for your Windows directory. Here are the steps: 1. Select Applications . Accessories . Terminal to open a GNOME Terminal window, and then type the following: sudo mkdir /media/windows_ntfs 2. To open the fstab file in the Gedit text editor, type the following in the GNOME Terminal window: sudo gedit /etc/fstab

CHAPTER 12 MANAGING YOUR FILES Note It s (Top ten web hosting)

Tuesday, October 9th, 2007

CHAPTER 12 MANAGING YOUR FILES Note It s possible for an installation of Windows 2000 or XP to use FAT32 instead of NTFS, but this requires the user to make a deliberate choice during setup. Unless you know your Windows 2000 or XP system has been formatted with FAT32, it s very likely that it is NTFS. If the drive is available, an icon for it should appear on the desktop. Unfortunately, with Ubuntu 5.10, NTFS drives appear on the desktop, but when you try to use them, they aren t accessible because of incorrect permissions. You can get around this bug in a couple ways. The easiest is to use the Disks Manager program, as follows: 1. Start the Disks Manager by selecting System . Administration . Disks. 2. Select Hard Disk in the list on the left and click the Partitions tab on the right. Then click the partition relating to your Windows installation. 3. You need to mount the partition. I discuss mounting in detail in Chapter 15, but for the moment, it s enough to know that this can be done within the Disks Manager program. You need to provide an empty folder via which the partition will be made available. Usually, under Linux, the /mnt directory is used for temporary mounts such as this, so click the Change button and browse to this directory. Alternatively, you can simply type /mnt into the Access Path field. 4. Click the Enable button, and then click the Browse button next to it to access your Windows file contents, as shown in Figure 12-7. Note You should be able to read and write to FAT32 partitions, but you cannot write to or edit files in an NTFS partition. Although it is technically possible, it s not advisable because of various technical limitations. Therefore, the NTFS partition is made read-only. If you have a desperate need to write files to your Windows NTFS partition from within Ubuntu, you might consider converting it to FAT32. This can be done using a variety of commercial partitioning programs, such as PartitionMagic (www.symantec.com).

Java web server - 192 CHAPTER 12 MANAGING YOUR FILES Figure

Monday, October 8th, 2007

192 CHAPTER 12 MANAGING YOUR FILES Figure 12-6. You can select which program to use to open a file by right-clicking and selecting Open with Other Application. Accessing Windows Files Running Ubuntu on your PC makes you a relative stranger in a world of Windows users. It s likely that you ll need to access Windows files on a regular basis. If you ve chosen to dual-boot with Windows, you might want to grab files from the Windows partition on your own hard disk. If your PC is part of a network, you might want to access files on a Windows-based server or workstation on which a shared folder has been created. Working with Files in Windows Partitions Ubuntu may or may not make your Windows partitions available automatically. It depends on whether your Windows partition is FAT32, as used with Windows 95, 98, and Me, or NTFS, as used with Windows NT, 2000, and XP. FAT32 partitions will be instantly accessible, but making NTFS partitions accessible requires some work.

CHAPTER 12 MANAGING YOUR FILES 191 Table (Web design)

Monday, October 8th, 2007

CHAPTER 12 MANAGING YOUR FILES 191 Table 12-1. Common File Types File Type File Extension Viewer Location on Applications Menu Word processor document .doc, .rtf OpenOffice.org Writer Office . OpenOffice.org2 Writer Spreadsheet .xls OpenOffice.org Calc Office . OpenOffice.org2 Calc Presentation .ppt OpenOffice.org Impress Office . OpenOffice.org2 Impress PDF file .pdf Evince Not on Applications menu1 Compressed file .zip, .tar, .gz, .bz2, and others File Roller Accessories . Archive Manager Image file .jpg, .gif, .tif, .bmp, and others Eye of GNOME Graphics . Image Viewer HTML file .htm, .html Firefox Internet . Firefox Web Browser Text file .txt, .log Gedit Accessories . Text Editor Audio file .wav Rhythmbox Sound & Video . Rhythmbox Music Player Video file .mpg, .mpeg, .avi Totem Sound & Video . Totem Movie Player 1 For some reason, Evince is not present on the Applications menu, although it is installed by default and associated with PDF files. If you wish, you can add your own shortcut following the instructions in Chapter 10. If you want to change the program associated with a file type, right-click the file, select Open with Other Application, and choose the other program, as shown in Figure 12-6. From that point on, every time you right-click, you ll be offered the choice of the program to open the file. Note Under Windows, you can use Windows Explorer to launch program executables by just browsing to their location within Program Files and double-clicking their .exe file. It s technically possible to run programs by browsing to their location using Nautilus, but this is discouraged. One reason is that Ubuntu doesn t store all of its programs in one central folder, as does Windows. However, most programs that are used on a daily basis can be found in /usr/bin. If the program itself isn t stored in /usr/bin, it will contain a symbolic link (effectively, a shortcut) to the program s genuine location on the hard disk.

190 CHAPTER 12 MANAGING (Web hosting comparison) YOUR FILES Note

Sunday, October 7th, 2007

190 CHAPTER 12 MANAGING YOUR FILES Note You might be used to dragging-and-dropping files onto program windows or taskbar buttons within Windows in order to open the file. This works with only some programs within Ubuntu. Generally, the best policy is to try it and see what happens. If the program starts but your file isn t opened, it obviously didn t work. HIDDEN FILES AND DIRECTORIES When you view your /home directory via Nautilus, you re not seeing every file that s there. Several hidden files and directories relating to your system configuration also exist. You can take a look at them by clicking View . Hidden Files in the Nautilus menu. Clicking this option again will hide the files and directories. You might notice something curious about the hidden items: they all have a period before their filenames. In fact, this is all that s needed to hide any file or directory: simply place a period at the front of the filename. There s no magic involved above and beyond this. For example, to hide the file partypicture.jpg, you could simply right-click it and rename it .partypicture.jpg. You ll need to click the Reload button on the toolbar for the file view to be updated and for the file to disappear. As you might expect, removing the period will unhide the file. Files are usually hidden for a reason, and it s no coincidence that most of the hidden files are system files. In addition, every program that you install, or is installed by default, will usually create its own hidden folder for its system configuration data. Deleting such files by accident can be catastrophic. Launching Files and Running Programs As with Windows, most of the programs on your Ubuntu system automatically associate themselves with various file types that they understand. For example, double-clicking a picture will automatically open the Eye of GNOME viewer application, and double-clicking a .doc file will start OpenOffice.org Writer. Ubuntu is automatically set up to view common file types. However, you might find Table 12-1 useful. It shows which programs are required for viewing certain types of documents. Note Whenever you install new software from the installation CD or the official software repositories, it should add an entry to the Applications menu. If for some reason this doesn t happen, you can create a shortcut using the techniques explained in Chapter 10.

CHAPTER 12 MANAGING YOUR FILES Figure 12-5. (Hosting your own web site)

Saturday, October 6th, 2007

CHAPTER 12 MANAGING YOUR FILES Figure 12-5. A variety of miniature emblems can be applied to an icon to aid recognition of the file. Special Nautilus Windows As well as letting you view your files, Nautilus has a number of object modes. This is a complicated way of saying that Nautilus lets you view things other than files. The most obvious example of this is the computer view of your file system, which presents an eagle s eye view of your storage devices. To access this view, click Places . Computer. If you have a card reader attached, it will appear here, as will any Windows partitions that may be on your hard disk. Double-clicking each item opens a standard Nautilus file browser window (for this to work with Windows partitions, they must be set up correctly, as described in the Accessing Windows Files section later in this chapter). Another Nautilus object mode is the fonts view, which lets you see at a glance any fonts installed on your computer. To access fonts view, click Go . Location in any open Nautilus window, and then type fonts://. Object mode come into its own when viewing network locations. Clicking Places . Network Servers brings up the browsing network object view, for example. You can also browse to FTP sites by clicking Go . Location in a file browser window and entering an FTP address (prefacing it with ftp://).

Free web design - 188 CHAPTER 12 MANAGING YOUR FILES Places

Saturday, October 6th, 2007

188 CHAPTER 12 MANAGING YOUR FILES Places pane: The Places pane on the left lists the most popular locations within the file system. Double-clicking each icon takes you to that location instantly. Clicking the File System entry takes you to the root of the file system (/). As under Windows, you can right-click each file in the file browser window to see a context menu with options to rename the file, delete it, open it with particular applications, and so on. The Properties option on the context menu lets you view information about the file and alter certain aspects of it, such as its access permissions (discussed in Chapter 15). You can even add some text notes about the file if you wish! Caution You should never delete your /home folder. Doing so will most likely destroy your personal Ubuntu setup and prevent you from logging in. File and Folder Icons You can change the icon for any file or folder to whatever you want. Right-click the file or folder, and then click the Select Custom Icon option. You can choose from a wide range of supplied icons or click the Browse button and locate your own graphic. Virtually any image can be used, regardless of format or even size, so you can use digital camera snapshots if you wish. Files and folders can also have emblems applied to them. These are smaller icons that are tagged on to the larger icons in both list view and icon view. Emblems are designed to give you quick clues about the nature of the file. To apply an emblem, right-click the file or folder, select Properties, and then click the Emblems tab. As shown in Figure 12-5, a range of icons is available; in fact, any file or folder can have several emblems applied at once. Simply put a check in the box beside the icons you wish to apply. Note Nautilus makes use of a handful of emblem icons for its own needs, too. For example, a file with a lock emblem attached to it indicates that you don t have the necessary file permissions to edit or delete that file. An X emblem means you don t have permissions to access that file or folder at all, not even to view it. In most cases, the emblems are self-explanatory.

CHAPTER 12 (Net web server) MANAGING YOUR FILES Location bar:

Friday, October 5th, 2007

CHAPTER 12 MANAGING YOUR FILES Location bar: This feature, located beneath the toolbar, is unique to Nautilus and lets you see where you are in your file system, as well as quickly and easily move through your file-browsing history. For example, if you to start in /home/keir and then browse to /home/ keir/pictures/holiday/disneyworld, clicking the Pictures button will return you to /home/keir/pictures. The other folders listed on the location bar (holidayand disneyworldin this example) won t disappear, so you can return to those as well. It s best demonstrated by example, so give it a try! Zoom controls: To the right of the location bar are the zoom controls. These make the icons representing the files bigger or smaller. When you re browsing a lot of files at once, shrinking them will fit more in the window. On the other hand, when you re viewing photo thumbnails, it can be handy to increase the zoom setting so you can see more detail in the pictures. View As Icons/List: To the right of the zoom controls is a drop-down list that switches between icon and list view. List view shows details about the files, such as file size, the type of file, its permissions, and so on. Icon view presents the files as a series of large icons. In many cases, the icons will give a clue as to the nature of the file; for example, MP3 files appear with speaker and musical note graphics. If the folder you re browsing contains image files (or certain document files, such as PDFs), these will be automatically thumb- nailed the icon will be a small version of the contents of the file, as shown in Figure 12-4. This is very handy when browsing pictures for printing or editing. Figure 12-4. Whenever you view a folder full of pictures in icon view, they will be automatically thumbnailed.

186 CHAPTER (Web hosting packages) 12 MANAGING YOUR FILES Files

Thursday, October 4th, 2007

186 CHAPTER 12 MANAGING YOUR FILES Files within Ubuntu remember who owns them. If user johnsmith creates a file, he can make it so that only he can read or write the file (the default setting is that other users will be able to read the file but not write any new data to it). Directories, too, are owned by people, and the owner can set access permissions. By default, all users on a system can access each other s /home directories and read files, but they won t be able to change the files or write new files to any directory within /home that isn t theirs. Note Any user with superuser powers has access to all of the system and can create, edit, and delete files in all directories. This is so that user can perform essential system maintenance. Using Nautilus Nautilus is the name of the default file browser in Ubuntu. It s not dissimilar to My Computer/Windows Explorer under Windows in that it presents a list of files on the right side of the window and a series of shortcuts to popular locations within the file system on the left side. Starting Nautilus is simply a matter of clicking the Places menu and choosing a location, as shown in Figure 12-3. Alternatively, you can click Applications . Accessories . File Browser, which will open the default browsing location (your /home folder). Figure 12-3. You can open a file browser window by selecting a location under the Places menu. The Nautilus window (see Figures 12-1, 12-2, and 12-4) consists of several elements: Menu bar: The menus offer options for controlling the way files are displayed in the Nautilus window, as well as the look and feel of Nautilus itself. The Bookmarks menu lets you create web-browser-like shortcuts to certain locations in your file system so you can access them instantly. Toolbar: As in a web browser, the toolbar allows you to quickly move backward and forward from place to place in your browsing history. In addition, you can reload the file listing, in order to reflect any changes that might have taken place since the Nautilus window opened, and quickly navigate to popular file system locations, such as your /home folder.