Tuy nhiên, khi bạn xóa một tập tin bằng cách sử dụng lệnh rm, tập tin hoàn toàn và ngay lập tức biến mất. Điều này có nghĩa rằng nếu bạn nhầm lẫn xóa một tập tin từ trình bao, bạn không thể phục hồi nó bằng cách kéo nó trở lại của Thùng rác. | WORK WITH FILES 2 DELETE A FILE You can use the rm command to delete files you no longer want to keep. When you delete a file using the Mac OS X Finder in Aqua the Finder does not immediately delete the file but stores it in the Trash. However when you delete a file using the rm command the file completely and instantly disappears. This means that if you mistakenly delete a file from the shell you cannot recover it by simply dragging it back out of the Trash. As with the cp and mv commands deleting files can be dangerous because people can make mistakes. You can use the -i option to tell the rm command to confirm that you want to delete a file if you do you can type y for yes and press Return. If you do not you can press any other key or simply the Return key. By default the rm command only removes ordinary files although you can remove an empty directory with the rmdir command for a directory containing files you can use the rm -r command. You cannot remove directories unless they belong to you or you have write permission to the files. However there is no special access permission required to delete a file. It is possible to delete a file whose name begins with a dash such as -foo or -bar. These are extremely hard to remove because the rm command tries to interpret the filenames as an option because options begin with dashes. In this situation you can use the option -- a double dash . This means that the command does not check the rest of the line for more options making this your last option flag. DELETE A FILE DELETE A FILE_ L n Type rm and a space. DELETE A FILE SAFELY Q Type the name of the file and press Return. The shell deletes the file. - Type rm -i and a space. s Type the name of the file and press Return. The shell asks you if you want to delete the file. Type your response and press Return. The rm command either deletes the file or abandons the operation depending on your response. 23 UNIX FOR MAC CHANGE FILE PERMISSIONS You can change the .