63Chapter 2Running Commands from the ShellCreating Files and (Cheapest web hosting)

63Chapter 2Running Commands from the ShellCreating Files and DirectoriesAs a Linux user, most of the files you save and work with will probably be in yourhome directory. Here are commands to create and use files and directories: CommandResultcdChange to another current working directory. pwdPrint the name of the current working directory. mkdirCreate a directory. chmodChange the permission on a file or directory. lsList the contents of a directory. The following steps lead you through creating directories within your home direc- tory and moving among your directories, with a mention of setting appropriate filepermissions: 1.Go to your home directory. To do this, simply type cd. (For other ways ofreferring to your home directory, see the Identifying Directories sidebar.) 2.To make sure that you got to your home directory, type pwd. When I do this, Iget the following response (yours will reflect your home directory): $ pwd/home/chris3.Create a new directory called testin your home directory, as follows: $ mkdir test4.Check the permissions of the directory: $ ls -ld testdrwxr-xr-x 2 chris sales 1024 Jan 24 12:17 testThis listing shows that test is a directory (d); followed by the permissions(rwxr-xr-x), which are explained later in the Understanding File Permissions section; the owner (chris); the group (sales); and that the file was mostrecently modified on Jan. 24 at 12:17 p.m. In some Linux systems, such as Fedora Core, when you add a new user, the user isassigned to a group of the same name by default. For example, in the precedingtext, the user chriswould be assigned to the group chris. This approach toassigning groups is referred to as the user private group scheme. For more infor- mation on user private groups, see Chapter 4. For now, type the following: $ chmod 700 testNote07_
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision servlet hosting services

Leave a Reply