본문 바로가기

IT/etc

inum 가지고 find를 해서 파일제거 하기

가끔씩 무슨 이유로 파일 시스템에 이상하게 생긴 이름의 파일이 보일 때가 있다. 아마도 버퍼에 있던 텍스트들이 커맨드라인에서 실행이 되어 버렸을때 나타나는 듯 하다.  그런 파일들은 제거하기가 일단 쉽지가 않다. 


Somehow file name got corrupted and not possible to delete by typing its name since command line wouldn't take weird characters.

In this case, you might want to use find-rm.
Here is what you can do. (Assume file's inum is 34406448)

###bash
find . -inum 34406448 -exec rm -rf {} \;