nohup으로 백그라운드 실행시 점점 nohup이 커지는데.. 꼭 로그를 남기지 않아도 된다면!
nohup ./wt_start.sh 1>/dev/null 2>&1 &
1.filebeat_start.bat파일 생성
#filebeat_start.bat
filebeat -c filebeat_mnsv.yml
cmd창에서 명령어를 입력하지 않고 bat파일을 클릭해 실행시킬 수 있다.
.vbs 파일 생성해서 백그라운도로 돌리기
#filebeat_start.vbs
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "D:\Filebeat\filebeat-8.13.0-windows-x86_64\filebeat" & Chr(34), 0 #실행할 명령어
Set WshShell = Nothing
생성한 filebeat_start.vbs를 더블클릭하면 아무 반응이 없는데 cmd창에서 실행하는지 확인해보면 잘 띄워져 있다.
tasklist | findstr "filebeat.exe" # filebeat.exe 이름으로 실행하는 프로세스 실행 확인하기
taskkill /im filebeat.exe # filebeat.exe 이름으로 실행하는 프로세스 죽이기
grep -o (단어)hello (파일)file.txt | wc -w
kill `ps -ef | grep $이름 | grep -v grep | grep -v tail | awk '{print $2}'`