Sunday, December 30, 2012

How to find the process ID of running process and kill a process in Ubuntu/Linux

Using PS Commands

PS Commands gives out information of currently running process with process IDs(PID).Easy way to find a PID of a process is to use PS commands.I have described full article about how to find process details along with process ids and how to kill a user specified process.

Listing all running processes in the system


Linux systems offer commands to list each and every process runs in the system
   
 Command:    ps -aux | less

 Output:




Finding a process by specifying a name

User is capable of finding the process id and the details of a process by specifying the process name along with the commands.This is one of advantage of pipe and filter architecture in the Ubuntu.In the output image the process details can be describe as follows.First line "harsha" is the owner of the process and the next "5914" is the process id of the process.For more details

    Command : ps -aux | grep {process name}
    
Example:
  • See all java process
$ ps -aux | grep java (This will list the all the java processes)
   Output:

Finding the process id of a process

     Command:  pidof {Process Name} 

     Example:
     
$ pidof  java
    Output:
     
    

Other important commands regarding processes in Ubuntu/Linux Systems 

  • process except those running as root
   $ ps -U root -u root -N
  • See process run by user harsha
       $ ps -u harsha                                                                                                                                                                                            

Kill a user specified process

At some movements user need to kill a process after identified required process id by using above methods.

Command: kill {process id} or kill -9 {process id}

Example:
  • Kill a process
    $ kill  3486
  • Kill a process forcefully(Sometimes force kill required for kill a processes which are not kill by normal kill command. "-9" is specify a forceful kill.
$ kill -9 3486

References



Saturday, December 29, 2012

How to change the theme of IntelliJ Idea 12

Intellij idea has announce latest version of their IDE for java development which come with theme call 'Dracula'.Changing the theme is very simple follow simple steps as listed in below



1. Ctrl+~

2. Switch Look and Feel

3. Choose any theme(You may prefer dracula)

4. Restart

Done!

Sunday, October 14, 2012

Intellij IDEA keyboard shortcuts

Intellij IDEA is a one of very powerful and popular IDE available in the software development industry.It provides number of shortcuts which speed up the coding.Shortcuts are very easy to use and save huge amount of time of the software developer.Below I have listed intellij IDEA shortcuts.

Compile And Debugging shortcuts


Edit shortcuts


Navigation shorcuts

Search shortcuts
Re factoring and Version Control System shortcuts
Other shortcuts

Sunday, August 12, 2012

How to recursively delete directory or file in Ubuntu

Recursively deleting a file which ends in specific file type or deleting a directory which has a specific name is major requirement in sometimes.For a example when you creating patches or providing directories commit,you should clear all .svn directories and other unnecessary files.This will become a headache for if you going yo delete those files or directories one by one.Here is the easy way of doing it.

Deleting a file recursively with user permission
  • find . -type f -name "*.iml" -exec rm -i {} \;
Delete all files which ends with  ".iml" extension recursively with asking the user permission to delete each file.With the "-i" option this allow user to decide whether which file is to delete and which file not to delete each time.


Deleting a file recursively without user permission
  • find . -type f -name "*.iml" -exec rm -f {} \;
Delete all files which ends with  ".iml" recursively at once.

Deleting a directory recursively without user permission
  • find -type d -name '.svn' -exec rm -rfv {} \;
Delete all directories which ends with  ".svn" recursively at once






Tuesday, July 3, 2012

Terminator Ubuntu Terminal

Here is my blog post after a long break.It's a kind of transition period of me to shift with Ubuntu by letting windows 7 to go.Terminator is a alternative and a competitor for Ubuntu default terminal.Ubuntu default terminal only allow you to create a multiple tab,but not allow you to split vertically or horizontally.Like in below image you can have any number of terminals.This makes your works more easy.


Install Terminator
sudo apt-get install terminator

Run terminal using
Ctrl+Alt+T

Then you can have the terminator
Terminator shortcuts

Ctrl-Shift-E: Split the view vertically.
Ctrl-Shift-O: Split the view horizontally.
Ctrl-Shift-P: Focus be active on the previous view.
Ctrl-Shift-N: Focus be active on the next view.
Ctrl-Shift-W: Close the view where the focus is on.
Ctrl-Shift-Q: Exit 
F11: will make terminator go fullscreen

Enjoy!