Inside Linux You press Enter and suddenly realize (Make web site)

Inside Linux You press Enter and suddenly realize you are still in /usr/bin! Sorry, there is no way to unerase files. As a precaution, you can use the -i option to rm -this option puts the rm command into interactive mode. For each file to be deleted, rm asks the user for y/n confirmation. You can also use the wildcard character to specify a filename template for deletions. The following is an example: stimpy $ rm swi* In this instance, rm will remove all files that begin with the character sequence swi. The opposite can be achieved: stimpy $ rm *ity In this example, all files that end with ity will be removed. A second, albeit strange, method of deleting files exists. Many Linux veterans will ask, “Why?” How about, “because you can.” Here it is - deleting a file using /dev/null: stimpy $ mv myfile.txt /dev/null We will discuss the mv (move) command in a section that follows. Let’s take a look at removing directories. The command to do this is rmdir (remove directory). The syntax for rmdir is as follows: rmdir [options] directories The named directories are removed from the parent. The directories to be removed must be empty. As previously shown, rm -r can be used to remove a directory and its contents in one fell swoop. The following is a dialog to remove a user’s home directory that no longer uses the system: stimpy $ cd ~gbye stimpy $ ls names.txt accounting.xls company.doc employees.dbf stimpy $ rm * stimpy $ cd .. stimpy $ rmdir gbye rmdir: gbye: directory not empty stimpy $ A user’s home directory contains files that begin with a period (.). Any files that begin with . are not displayed with ls. You should use the option -al to see all files in a directory. As with the /dev/null trick with files, you can also remove directories with this unorthodox method: stimpy $ cd ~gbye stimpy $ ls names.txt accounting.xls company.doc employees.dbf stimpy $ cd .. stimpy $ mv gbye /dev/null stimpy $ NOTE Unfortunately, there is no way to undelete files or directories. Think twice before you run the command rm -r *. Viewing Files We can use a number of methods to view a file. One command that is at our disposal is more. The syntax for more is more [options] files The more command has a number of options available. Be sure to check the man page for the available options. more will output the contents of files, one screenful at a time. If you press the Spacebar, the next screen of text is displayed. The following is an example of the more command: stimpy $ more .profile page 58
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

Leave a Reply