Chapter 6 . Managing Files 245 (Virtual web hosting) In this
Chapter 6 . Managing Files 245 In this example, the ddcommand is used to copy a file from the Linux boot partition to another partition formatted using the FAT file system. This command is also useful when converting files from ASCII to EBCDIC, the Extended Binary Coded Decimal Interchange Code used by IBM, such as when working with tape backup systems. Moving files It is possible to move a file manually by copying it to the new location and erasing the original file. However, Linux includes a command for moving files that automates these tasks. The mv command (short for move) allows you to move and rename files on Linux systems. This command works much like the cp command covered earlier in the chapter, using the same command syntax. The options used with the mvcommand are a bit different and are covered in Table 6-9. Table 6-9 Options Used with mv Option Use -i Prompts the user before overwriting files. -u Specifies that files are not moved to a destination with the same or newer modification times. -v Verbosely prints the names of files as they are moved. -f Removes existing files without prompting. In the following example, all filenames matching the pattern beginning with file are moved verbosely to the myfiles directory. # mv -v file* myfiles fileaa -> myfiles/fileaa fileab -> myfiles/fileab fileac -> myfiles/fileac filead -> myfiles/filead fileae -> myfiles/fileae filespace -> myfiles/filespace In the second example, the directory myfilesis renamed to files. # mv myfiles files
In case you need quality webspace to host and run your web applications, try our personal web hosting services.