Find and delete file or directory on Linux. Find and kill process by port on Windows

Posted on August 9, 2016, 9:37 pm


LINUX : FIND AND DELETE FILE OR DIRECTORY

Syntax

find . -name "WHAT YOU WANT TO FIND" -exec rm -r -f {} \;

ex:

find . -name ".settings" -exec rm -r -f {} \;
find . -name ".project" -exec rm -r -f {} \;
find . -name ".classpath" -exec rm -r -f {} \;

find . -name "target" -exec rm -r -f {} \;
find . -name ".git" -exec rm -r -f {} \;
find . -name ".idea" -exec rm -r -f {} \;

find . -name ".gitattributes" -exec rm -r -f {} \;
find . -name ".gitignore" -exec rm -r -f {} \;

WINDOWS : FIND AND KILL PROCESS BY PORT

Syntax

netstat -a -o -n | findstr "LISTENING" | findstr ":XXXX"
taskkill /F /PID

XXXX : port number that you want to find

ex:

Find and kill process by port on Windows


netstat -a -o -n | findstr "LISTENING" | findstr ":8080"
netstat -a -o -n | findstr "LISTENING" | findstr ":8080"

2252 : port number that i want to kill

Blog Archive

  • 2023-May (1)
  • 2023-February (1)
  • 2020-October (1)
  • 2020-May (1)
  • 2020-February (2)
  • 2019-December (5)
  • 2019-November (1)
  • 2018-July (1)
  • 2017-December (1)
  • 2017-November (1)
  • 2017-June (1)
  • 2016-September (5)
  • 2016-August (3)
  • 2016-June (1)
  • 2015-September (1)
  • 2015-May (1)
  • 2015-February (2)
  • 2014-December (1)
  • 2014-November (2)
  • 2014-September (3)
  • 2014-August (1)
  • 2014-June (1)
  • 2014-May (1)
  • 2014-March (1)
  • 2013-December (2)
  • 2013-October (2)
  • 2013-July (1)
  • 2013-June (3)
  • 2013-May (4)
  • 2013-March (1)
  • 2012-December (2)
  • 2012-November (1)
  • 2012-October (1)
  • 2012-September (2)
  • 2012-August (2)
  • 2012-July (2)
  • 2012-June (1)
  • 2012-May (2)
  • 2012-March (2)
  • 2012-February (2)
  • 2012-January (5)
  • 2011-December (2)
  • 2011-November (4)
  • 2011-October (5)
  • 2011-September (2)
  • 2011-August (1)
  • 2011-June (2)
  • 2011-May (1)
  • 2011-April (9)
  • 2011-March (3)
  • 2011-February (12)
  • 2011-January (16)
  • 2010-December (17)
  • 2010-November (6)
  • 2010-October (10)
  • 2010-September (8)