Thursday, June 17, 2010

Linux for Java Programmer - Tomcat and File Operation

1. Download Tomcat


wget http://apache.mirror.aussiehq.net.au/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz


2.Extract tar file


tar xvzf apache-tomcat-6.0.26.tar.gz


3. list directory


ls
-l
-s show hide file

4. Move file to another directory


sudo mv apache-tomcat-6.0.26 /usr/local/tomcat
Folder "apache-tomcat-6.0.26" will be moved to "usr/local" and renamed as "tomcat"

5. go to directory


cd /usr/local/tomcat/webapps
Press "tab" key can get your directory name completed automatically.
cd ..
cd ~

6. Delete file or directory

Let's delete a single file, "RUNNTING.txt"
rm RUNNTING.txt
Let's delete the example webapp
rm -rf examples
Remove all files and directories (recursive removal)

7. Start and shutdown Tomcat

start:
sh /usr/local/tomcat/bin/startup.sh
shutdown:
sh /usr/local/tomcat/bin/shutdown.sh

0 comments: