Showing posts with label Terminal. Show all posts
Showing posts with label Terminal. Show all posts

Monday, October 7, 2013

Find and Replace the String


So long time i was searching for single terminal grep or sed or find command that could find and replace all the place the string value in the document!

Finally i found the command!.

find /path -type f -exec sed -i 's/OldString/NewString/g' {} \;

This command will replace the OldString with NewString. If you want to search with the folder then your path should be "./"

Thursday, April 4, 2013

Cool Terminal Commands to identify your OS detail

I want get the details about my current Ubunutu OS that has been installed in my machine!
as a result of google search. I found few cool commands!


1) uname -a

This command will retrieve you, full detail of the OS that install in your computer.

Linux vanjikumaran-ThinkPad-T530 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux



2) lsb_release -d


This command should give you the the description including the OS name ("Ubuntu" on an Ubuntu system) and the release number.

Description:    Ubuntu 12.10
 

3) lsb_release -c

This will give you just the codename.

Codename:    quantal

 
4) lsb_release -r

This will give you just the release number only.

Release:    12.10


5) lsb_release -a

This will provide you full lsb detail.

No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 12.10
Release:    12.10
Codename:    quantal

Monday, April 1, 2013

Create a Web Application project using Maven


This post i will briefly guide you how to create a simple web Application using maven tool.

Since i am using intellij IDEA As IDE, by default the project that i am creating will be created in the "IdeaProjects" directory.

In order to demonstrate this task, i am creating a web app called SampleWebApp.

mvn archetype:create 
-DarchetypeGroupId=org.apache.maven.archetypes 
-DarchetypeArtifactId=maven-archetype-webapp 
-DarchetypeVersion=1.0 
-DgroupId=com.sample.test 
-DartifactId=SampleWebApp 
-Dversion=1.0-SNAPSHOT





As a result of running above given code snippets in the terminal or cmd, you will get bellow directory and file structure. This automated process is reducing the workload of the developer.




Now you can use your IDE to open up the projects and start coding.





for further reading about maven
[1]http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
[2]http://www.sonatype.com/books/mvnref-book/reference/