Ubuntu/linux Command (51) 썸네일형 리스트형 Linux Basic Command (date) 날자를 문자열로 출력 용례1 : date 옵션없이 사용하면 현재 날자를 출력하며 포맷은 locale 설정에 따라 달라짐 용례2 : date "+%Y-%m-%d" 날자를 YYYY-MM-DD 포맷으로 출력. 시간,초는 아래 키워드를 사용 24 시간: %H 12시간: %I 분: %M 초: %S 오전/오후: %p unix time stamp: %s(소문자) 용례3 : date "+%Y-%m-%d %H:%M:%S" 2021-08-05 13:57:41 date "+%Y-%m-%d %l:%M:%S %p" 2021-08-05 1:59:39 PM 특정 날자 구하기 -d 옵션뒤에 구할 날자의 문자열을 지정. 용례1 : date -d "-1 days" 어제 날자 용례2 : date -d "-1 weeks" 한주전 용례3 :.. Linux Basic Command (rm) 파일 및 디렉토리를 제거하는 명령어 (remove) 화일 삭제 용례1 : rm test.txt test.txt 파일 삭제 용례2 : rm *.txt 확장자가 .txt 인 모든 파일 삭제 용례3 : rm * 현재 디렉토리에 있는 모든 파일 삭제 (디렉토리가 있다면 삭제할 수 없다는 메시지 띄움) 용례4 : rm -f * 현재 디렉토리에 있는 모든 파일 강제 삭제 (묻지 않고 바로 삭제) 디렉토리 삭제 용례1 : rm -r test test 디렉토리 삭제 용례2 : rm -rf test test 디렉토리 강제삭제 용례3 : rm -r * 현재 디렉토리에 있는 모든 파일과 디렉토리 삭제 용례4 : rm -rf * 현재 디렉토리에 있는 모든 파일과 디렉토리 강제삭제 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.. 이전 1 ··· 3 4 5 6 7 다음