chmod 755 (1 on 1 web hosting) files rwxr-xr-x chmod 644 files

chmod 755 files rwxr-xr-x chmod 644 files rw–r -r– chmod 000 files ——— When you try to create a file, by default it is given the permission: rw-r–r–. A directory is given the permission rwxr-xr-x. These default values are determined by the value of umask. Type umask to see what your umask value is. For example: $ umask Subtract the number you see in each of the three sets from seven and you will see the value of each of the fields. The umask of 022 results in permission for a directory of 755 (rwxr-xr-x). That same umask results in a file permission of 644 (rw-r–r–). (Execute permissions are off by default for regular files.) Tip Here s a great tip for changing the permission for lots of files at once. Using the -R options of chmod, you could change the permission for all of the files and directories within a directory structure at once. For example, if you wanted to open permissions completely to all files and directories in the /tmp/test directory, you could type the following: $ chmod -R 777 /tmp/test This command line runs chmod recursively (-R) for the /tmp/test directory, as well as any files or directories that exist below that point in the file system (for example, /tmp/test/hat, /tmp/test/hat/baseballcaps, and so on). All would be set to 777 (full read/write/execute permissions). Caution The -R option of chmod works best if you are opening permissions completely or adding execute permission (as well as the appropriate read/write permission). The reason is that if you turn off execute permission recursively, you close off your ability to change to any directory in that structure. For example, chmod -R 644 /tmp/test turns off execute permission for the /tmp/test directory, then fails to change any files or directories below that point. Moving, copying, and deleting files Commands for moving, copying, and deleting files are fairly straightforward. To change the location of a file, use the mv command. To copy a file from one location to another, use the cp command. To remove a file, use the rm command. Here are some examples: $ mv abc def $ mv abc ~ $ cp abc def $ cp abc ~ $ rm abc $ rm * Of the two move (mv) commands, the first moves the file abc to the file def in the same directory (essentially renaming it), whereas the second moves the file abc to your home directory (~). The first copy command (cp) copies abc to the file def, whereas the second copies abc to you home directory (~). The first remove command (rm) deletes the abc file, whereas the second removes all the files in the current directory. Note For the root user, the mv, cp, and rm commands are aliased to each be run with the -i option. This causes a prompt to appear asking you to confirm each move, copy, and removal, one file at a time. This is done to prevent the root user from messing up a large group of files by mistake. Using the vi Text Editor It s almost impossible to use Red Hat Linux for any period of time and not need to use a text editor. If you are using a GUI, you can run xedit, which has a fairly intuitive interface for editing text. Most Red Hat Linux shell users will use either the vi or emacs commands to edit plain-text files. The advantage of using vi or
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web and email hosting services

Leave a Reply