라벨이 find인 게시물 표시

Find file in Linux!

find $HOME -name 'name' -print Thanks, JF

Replacing words within files in linux (find, sed)

이미지
Hi. When you want to replace words in files, do like this! 1. Find files having words you want to replace 2. Change it ! Here is example! I want to replace all "Fe" to "Mo" at all POSCAR files. Thanks, Jin-Myoung Lim

Finding files with name "XXX" in linux

이미지
Hi, When you want to find files with name "XXX", you can use this at this folder. >> find ./ -name "XXX" Here is example. I wanted to find files with name including "POSCAR*" >> find ./ -name "POSCAR*" Thanks, Jin-Myoung Lim

File searching and Remove the searched files in Unix/Linux shell

When it comes to Linux/Unix operating system, you can use shell. 1. Identify detail information of files >>> ls -l 2. Identify detail information of files including sub folders >>> ls -lR or >>> ls -lRs 3. Search files which begin with test >>> ls -lRs | grep -i test* by using '-i' option, you can display the information of location (folders) or >>> find . -name 'test*' -print this would be searching from this present folder 4. Search files which begin with test and then remove all or them >>> find . -name 'test*' -exec rm {} \; -exec command ;       : Execute command. {}                         : The string {} is replaced by the current file name \                         : For escaping 5. Some other usage >>> find . -type d -exec chmod 755 {} '; From this present folder, change all of folder's permission to 755 >>> find . -type f -exe