Inside Linux Creating (Anonymous web server) New Directories Okay, you need
Inside Linux Creating New Directories Okay, you need to start organizing your personal data files. You need to store them in your home directory. You have determined that you will need five directories: spreadsheet, database, documents, source, and timesheet. You know the directories you need, but how do you create a directory? You use the mkdir command. This is similar to the DOS command md. The syntax for mkdir is mkdir [options] directories The mkdir command creates one or more directories. You must have write permission (for the parent directory) to create a directory. Let’s see how we can use the mkdir command: stimpy $ cd stimpy $ pwd /home/mtobler stimpy $ ls name.txt stimpy $ mkdir spreadsheet stimpy $ ls name.txt spreadsheet stimpy $ mkdir database documents source stimpy $ ls database documents name.txt source spreadsheet stimpy $ mkdir timesheet stimpy $ ls database documents name.txt source spreadsheet timesheet stimpy $ If you recall, a directory is not like a file; it does not contain data, other than a list of files and directories. When you create a directory with mkdir, what actually happens is that Linux creates a new entry in the current directory’s list. Deleting Files and Directories Inevitably, you will discover files and directories that you no longer require. Help is on the way. Linux offers two commands - one for deleting files and one for deleting directories. Let’s start with deleting files. The rm (short for remove) command is used to delete one or more files. For the command to succeed, you must have write permission for the directory containing the file(s) and the named file(s). The rm command has several options; check the man page for details. The syntax is as follows: rm [options] files Two common options available are -r and -d. The -r option is used to recursively remove the contents of a directory. If the name given is a directory (instead of a file), remove the contents of the directory, including subdirectories, and then the named directory. NOTE Using -r is a very dangerous option. You can inadvertently remove a complete directory tree and its contents. Stop and think twice before executing rm with the -r option. You can use wildcards to delete files with rm. The following will remove all files in the current directory: stimpy $ rm * Always think about the directory you are in - you may not be where you think you are. Many people have fallen victim to this situation. You think the current directory is /devel/util and want to remove all files there. You execute the command: stimpy $ rm * page 57
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services