Managing Files and (Jetty web server) DirectoriesAs mentioned earlier,using a Linux
Saturday, June 30th, 2007Managing Files and DirectoriesAs mentioned earlier,using a Linux system involves navigating several directories and manip- ulating the files inside them.Thus,an efficient Linux user must understand how to create direc- tories as needed,copy or move files from one directory to another,and delete files anddirectories.These tasks are commonly referred to as file management tasks. Following is an example of a directory listing while the user is logged in as the root user: [root@server1 root]# pwd/root[root@server1 root]# ls -Fcurrent@ myprogram* project project12 project2 project4Desktop/ myscript project1 project13 project3 project5 [root@server1 root]#_ As shown in the preceding output,only one directory (Desktop),two executable files (mypro- gram and myscript),and several project-related files (project*) exist.Although this directorystructure is not cluttered and appears in an easy-to-read format on the terminal screen,typicalhome directories on a Linux system contain many more files;a typical Linux user might haveover 100 files in his home directory.As a result,it is good practice to organize these files intosubdirectories based on file purpose.Because several project files are in the root user s homedirectory in the preceding output,you could create a subdirectory called proj_files to containthe project-related files and decrease the size of the directory listing.To do this,you use themkdir (make directory) command,which takes arguments specifying the absolute or relativepathnames of the directories to create.To create a proj_files directory underneath the currentdirectory,you can use the mkdircommand with a relative pathname: [root@server1 root]# mkdir proj_files[root@server1 root]# ls -Fcurrent@ myprogram* project project12 project2 project4 proj_files/ Desktop/ myscript* project1 project13 project3 project5[root@server1 root]#_ Now,you can move the project files into the proj_files subdirectory by using the mv (move) command.The mvcommand requires two arguments at minimum:the source file/directoryand the target file/directory.If several files are to be moved,simply specify several source argu- ments;the last argument then becomes the target directory.Both the source(s) and destinationcan be absolute or relative pathnames,and the source can contain wildcards if several files areto be moved.For example,to move all of the project files to the proj_files directory,you couldtype mvwith the source argument project*(to match all files starting with the letters pro- ject ) and the target argument proj_files(relative pathname to the destination directory),asshown in the following output: [root@server1 root]# mv project* proj_files[root@server1 root]# ls -Fcurrent@ Desktop/ myprogram* myscript* proj_files/ [root@server1 root]# ls -F proj_files162Chapter 5LINUX FILESYSTEM MANAGEMENT
Note: If you are looking for high quality webhost to host and run your jsp application check Vision florida web design services