본문 바로가기

WEB23

Wildcards A wildcard is a character that can be used as a substitute for any of a class of characters in a search. * - represents zero or more characters ? - represents a single character [ ] - represents a range of chracters As you can see, if you created some files like below, it's not productive. Instead of creating each files, you can use a '{ }' wildcard. when you remove from abc1 to abc9, you can us.. 2024. 1. 29.
Difference between find and locate I wondered when I learned find and locate commands from the last lesson. I've got the answer today. locate uses a prebuilt databse, which should be regularly updated, while find iterates over a filesystem to locate files. Thus, locate is much faster than find, but can be inaccurate if the db is not updated. To update locate db run updatedb Here's an example: for running updatedb, you need to bec.. 2024. 1. 29.
명령어(find, locate) 파일을 찾을 때 유용하게 쓸 수 있는 명령어이다. 1. find find find 명령어 관련 예시이다. find . -name "Jerry" .(dot) 은 현재 위치해 있는 디렉토리 기준으로 "Jerry" 라는 파일 찾는 명령어이다. 위치를 전혀 모르는 경우에는 .(dot) 대신 /(slash)를 이용하면 root directory 밑으로 전체 경로를 다 찾을 수 있다. 2. locate locate locate 명령어를 통하여 경로 지정없이 해당 파일의 위치를 쉽게 찾을 수도 있다. 2024. 1. 28.
명령어(touch, cp, vi, mkdir) 파일과 경로 생성 명령어에 대해 정리 한번 하고 넘어가려 한다. 파일 생성 명령어로는 3가지가 있다. 1. touch touch 을 가진 파일을 생성한다. 2. cp cp copy 의 약자로 기존 파일인 을 의 이름으로 생성한다. cp 명령어에는 경로를 복사할 수 있는 옵션 -R 기능이 있다. cp -R ex) cp -R config /tmp/config-bak 예시의 명령어는 config 경로 파일을 /tmp/config-bak으로 복사한다. 이때 config 안에 있는 하위 폴더 및 경로들까지 전부 복사된다. 3. vi vi vi 명령어는 편집기 명령어로 명령어 실행 후에는 에디터 화면으로 넘어간다. 관련 내용은 향후에 심도있게 정리하려 한다. 마지막으로 경로 생성 명령어이다. mkdir 의 경로를 .. 2024. 1. 28.