Ubuntu (57) 썸네일형 리스트형 Linux Basic Command (mv) 파일을 이동하는 명령어 구문 : mv [옵션] [from 파일 및 디렉토리] [ to 파일 및 디렉토리] 용례1 : mv test.txt test2.txt test2.txt 파일이 없는 경우 test.txt 파일을 test2.txt 파일로 이름을 변경 용례2 : mv test.txt dir test.txt 파일을 dir 디렉토리로 이동 용례3 : mv test.txt test2.txt dir test.txt, test2.txt 파일을 dir 디렉토리로 이동 용례4 : mv dir1 dir2 dir2 디렉토리가 없을 경우 dir1 디렉토리를 dir2 디렉토리도 이름을 변경 용례5 : mv *.txt dir1 .txt 확장자를 가진 모든 파일을 dir1 디렉토리로 이동 용례6 : mv ../airbnb* ... Linux Basic Command (cp) 파일 및 디렉토리를 복사하는 명령어 사용구문 cp [옵션] [복사할 파일명] [붙여넣기할 파일명] 용례1 : cp test.txt test2.txt test.txt 파일을 text2.txt 로 이름을 바꾸어 복사 용례2 : cp test.txt test2 text2 directory가 없는 경우 test.txt 파일을 text2파일로 복사 text2 directory가 있는 경우 text2 directory 안에 test.txt 파일을 복사 용례3 : cp test.txt test2/test3.txt test.txt 파일을 text2 directory 안에 test3.txt 라는 이름으로 복사. 용례4 : cp -f test.txt /text2/text3.txt test.txt 파일을 text2 dire.. Linux Basic Command (find) 개요 : 파일 및 디렉토리 검색 용례1 : find text.txt 현재 directory 에서 text.txt 를 검색 용례2 : find dir dir 아래에 있는 파일 및 디렉토리 목록 검색 용례3 : find . -name "text.txt" 현재 디렉토리 및 모든 하위 디렉토리에서 test.txt 파일 검색 용례4 : find . -name "t*" 현재 디렉토리 및 모든 하위 디렉토리에서 t로 시작하는 파일 검색 용례5 : find . -name "*es*" 현재 디렉토리 및 모든 하위 디렉토리에서 'es'문자를 포함하는 파일 검색 용례6 : find . -name "*.txt" 현재 디렉토리 및 모든 하위 디렉토리에서 '.txt'로 끝나는 파일 검색 용례7 : find / -name "tes.. Linux Basic Command (mkdir/rmdir) 개요 : directory 생성, directory 제거 용례1: mkdir -p first/second/third -p : 하위를 만들기위해 필요한 경우 parent directory 도 생성함 mkdir -p a/b/c : c를 생성하기 위해 parent directory a/b도 생성됨 용례2 : mkdir dir1 dir2 dir3 mkdir aaa bbb ccc : aaa bbb ccc 를 연달아 만든다 mkdir aaa aaa/bbb aaa/bbb/ccc : aaa aaa/bbb aaa/bbb/ccc 를 연달아 만든다 용례3 : mkdir -m mkdir -m 754 aaa : u : rwx, g : rx, other: r 로 aaa 를 생성함 mkdir -m a=rwx aaa : all us.. Linux Basic Command (cd) cd : change directory (현재 디렉토리에서 다른 디렉토리로 작업위치를 변경) 용례1 : cd . : move to current working directory. cd ~ : move to user's home directory from anywhere. cd : move to user's home directory. cd .. : move to parent directory. cd - : move to previous directory 용례2 : cd [target directory path] cd : home directory 로 변경 cd /var/www : /var/www 로 변경 용례3 : cd -P [symbolic link] -P : change to physical loca.. Linux Basic Command (echo) 개요 : 인수로 전달되는 텍스트 / 문자열을 표시하는 데 사용. 이 명령어는 쉘 스크립트와 배치 파일에서 주로 현재 상태를 화면이나 파일로 출력하는데 사용되는 내장 명령어 용례1 : echo [문자열] echo "web makes the workd better" 용례2 : echo -e "web \nmakes \nthe \nworkd \nbetter" -e : enable interpretation of backslash escapes 용례3: echo "aaaa" >> test.txt >> : append "aaaa" to the last part of the test.txt 용례4 : echo "cccc" > test.txt > : crete test.txt with "cccc" by overwrit.. Linux Basic Command (clear) 개요 : 명령창 내용 삭제 용례1 : clear Linux Basic Command (which) 개요 : 명령어의 경로를 찾아주는 간단한 커맨드 라인 유틸리티 용례1 : which which vi which mysql which 는 PATH 에 지정된 경로를 순서대로 탐색하며 제일 처음 찾은 경로만 리턴. $ which vim /usr/bin/vim 용례2 : which -a vim -a : PATH 에 있는 모든 경로에서 검색 $ which -a vi /usr/bin/vim /bin/vi 이전 1 ··· 4 5 6 7 8 다음