Skip to main content

Linux Useful Commands with examples

To know the IP address
-----------
hostname -i (ip addres)
hostname -s (short name)
hostname -d (domain name)
hostname -v (host name with domain name)


To know the port number and running processes
netstat -ano | findstr 80

If the file is huge in size and to see the file content we can use
less <file name>
e.g. less service.log

Searching  matching pattern in file
grep '<matching text>' <file name>
e.g. grep 'Exception' service.log

To grep the text from .gz files
gzgrep '<matching text>' <gz file name>
e.g. gzgrep 'Exception' service.log.gz

ps -eaf | grep java
ps aus | grep java

tail -f <file Name> (auto updated last few lines)
tail -100 logfile.log  (last 100 lines)

ls -a  (hidden files)
ls -lrt (Sort the files by time stamp)

kill -9 <Process ID>   (get Process ID using ps -eaf | grep <process name>)
e.g. kill -9 30102

Comments

Popular posts from this blog

Maven Build Life Cyles

Following are the maven build life cycles.

Clean - Removes the generated files in 'target' folder.

command : mvn clean

Validate - It validates your project and verify all the necessary information is there in project or not.

mvn  valiate

Compile - It compiles your project code.

mvn compile

Package - It takes the compiled code and packaged to JAR/WAR/EAR. It also compiles your code if your code is not compiled.

mvn package

Install -   It takes the packaged code and puts in your local maven repository (M2_HOME). It also does the compile and package if these are not already been done.

mvn install

Deploy - It takes the package and puts in remote repository for sharing accross team members or for other projects.

mvn deploy


FYI - Above commands can be used as variety of combinations.
e.g. mvn clean install
mvn clean package
mvn clean compile package install

To skip the tests to run 
mvn clean install -DskipTests



NO SQL Types and vendors in market

NO SQL

KEY - VALUE Store  - Similar to a  MAP.
   e.g. Dynamo DB or REDIS

DOCUMENT Sore  - Similar to KEY-VALUE, value can be JSON/XML and key will be unqiuely idnetified this document.
   e.g. Coutch DB or mongoDB.

Column Store - Multi timentional table, identifying data with row and column numbers.
  e.g.  Cassandra or Apache HBase

Graph Store - Store relation between nodes (record entities). It has better transaction management
e.g. Neo4J and Orient DB.