?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
파일복사 (cp)

-사용법 : cp 복사할원본파일명 대상파일명

-현재디렉토리의 aaa.txt파일을 bbb.hwp파일로 복사
->shell> cp aaa.txt bbb.hwp

-현재디렉토리의 aaa.txt bbb.hwp ccc.doc 파일을 public_html 디렉토리안으로 복사
->shell> cp aaa.txt bbb.hwp ccc.doc public_html

-public_html 디렉토리를 통째로 html디렉토리라는 이름으로 복사
->shell> cp -r public_html html

-원본파일의 소유자.그룹을 그대로 가지고 복사

->shell> cp -p aaa.txt bbb.hwp


-원본파일의 속성이나 링크정보까지 포함

->shell> cp -a aaa.txt bbb.hwp


옵션을 여러가지 사용할때는

->shell> cp -apr public_html html

* @/var/named 디렉토리를 현재디렉토리로 복사해오고싶은경우
(현재디렉토리 . 상위디렉토리 ..)
->cp -r /var/named .

5. 디렉토리 만들기 (mkdir)

-사용법 : mkdir 만들디렉토리명
->현재디렉토리에 abc123디렉토리 만들기
shell>mkdir abc123
->abc123디렉토리안에 a1디렉토리를 만들고 a1디렉토리안에 a11디렉토리를 동시에만들기
shell>mkdir -p abc123/a1/a11
p : 하위디렉토리를 포함해서 디렉토리생성
->abc디렉토리안에 bl,cl,dl,el디렉토리를 동시에 만들기
shell>mkdir abc/{bl,cl,dl,el}

6. 파일삭제 (rm : remove)

-사용법 : rm -[옵션] 삭제할 파일명

-옵션종류 : r - 디렉토리를 삭제할때 사용하는 옵션
f - 물어보지 말고 강제 삭제
->현재 디렉토리의 aaa.txt 파일 삭제
shell>rm aaa.txt
->현재 디렉토리내의 named 디렉토리 삭제
shell>rm -rf named
->현재 디렉토리내의 a로 시작되는 모든 파일 삭제
shell>rm -rf a*
->현재 디렉토리내의 txt라는 확장자를 가지는 모든 파일 삭제
shell>rm -rf *.txt

7. 파일이동 (mv : move)

-사용법 : mv 이동할원본파일 대상파일명
->현재 디렉토리내의 abc파일을 bbc파일명으로 이동시키기 (파일명변경하기)
shell>mv abc bbc
->현재 디렉토리내의 abc123디렉토리를 public_html디렉토리내의 bbc123이름으로 옮기기
shell>mv abc123 public_html/bbc123

8. 절대경로와 상대경로

-디렉토리를 결정하는 경우 크게 절대경로와 상대경로 두가지로 표현가능

1. 절대경로 - 최상위 디렉토리를 기준으로 디렉토리명을 나열하는 방법
ex) /home/users/it309/public_html 형식으로 표현
2. 상대경로 - 현재 디렉토리를 기준으로 디렉토리명을 나열하는 방법
ex) 현재디렉토리가 /home/users/it309/public_html 이라고 할 경우
/home 디렉토리의 경로를 상대경로로 표현하면,
../../../
->it309 사용자가 로그인한 직후 /etc/mail 디렉토리 안으로 이동하는 방법을
절대경로와 상대경로를 이용하여 이동하는 명령어 구성.
1 - 절대경로 : $cd /etc/mail
2 - 상대경로 : $cd ../../../etc/mail

9. 디스크 사용량 확인 (du : disk used)

-사용법 : du -[옵션] 파티션명(디렉토리명)
-> /home 파티션의 사용량이 얼마인지 확인
du -K(M) /home
-> 현재 디렉토리의 디스크 사용량을 알기 쉬운 단위 (KB,MB)로 확인
du -hs .
↑(서브디렉토리내의 각각의 용량을 출력하지않고 전체용량만 출력)

10. 디스크의 남아있는 공간 확인 (df : disk free)

-사용법 : df -[옵션]
-옵션종류 : K -> Kbyte단위로 보여줌
M -> Mbyte단위로 보여줌
->하드디스크내의 모든 파티션 사용량과 남아있는 용량확인
df -m

11. 파일내의 내용 확인하는 명령어 (cat, head, tail, more, less...)

1 : cat
2 : head - 파일명을 인자로받아서 해당 파일내의 내용중 제일 첫번째줄을 기준으로
지정한 숫자에 해당하는 라인 내용을 읽어와 출력
-> head -n 파일명
/var/log/messages 파일 내용중 가장 오래전에 저장된 내용중 25라인만
읽어와서 출력
shell>head -25 /var/log/messages
↑시스템로그파일 : 리눅스시스템의 부팅시부터 각종
서비스를 사용하던 중 발생하는 모든
로그사항을 기록해두는 파일

3 : tail - head명령어와 반대로 가장 마지막줄로부터 지정된 라인수만큼 일어와출력
->/var/log/messages 파일 내용중 가장 최근에 기록된 내용중 30라인만 읽어와서 출력
shell>tail -30 /var/log/messages

4 : more - 파일명을 인자로 받아서 해당 내용을 출력시켜주는데 내용이 한페이지를
초과할 경우 한페이지씩 끊어서 출력하는 명령어
->shell>more /var/log/messages
다음페이지 : space bar
외부명령어입력 : !ls
강제종료 : ^C

5 : less - more 명령어와 동일하나 마지막 페이지에서부터 출력
->shell>less /var/log/messages

?

List of Articles
번호 제목 날짜 조회 수
64 #1040 - Too many connections // XE cannot connect to DB. 이런 에러 나올때 #1040 - Too many connections XE cannot connect to DB. 이런 에러 나올때 mysql 에서 max_connection 제한때문에 일어나는 에러 현재 msyql max_connetion 확인 #mysqladmin -u root -p variables | grep max_conne... 2013.11.20 36207
63 #145 - Table './DB/xe_documents' is marked as crashed and should be repaired phpmyadmin 에서 #145 - Table './DB/xe_documents' is marked as crashed and should be repaired centos mysqld.log 에서 [ERROR] /usr/local/mysql/libexec/mysqld: Table './DB/xe_documents' is marked as crash... file 2014.06.22 16959
62 (Owncloud) Error while trying to create admin user: An exception occured in driver: could not find driver 에러 해결 (Owncloud) Error while trying to create admin user: An exception occured in driver: could not find driver 에러 해결 php 확장 모듈에서 php_pdo_mysql.dll 추가 해 주면 됩니다. 테스트 환경 windows7 // auto... 2015.02.19 4096
61 1267 : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 에러명 select count(*) as cnt from g4_point where mb_id = 'admin' and po_rel_table = '01_1' and po_rel_id = '1' and po_rel_action = '쓰기' 1267 : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (u... 2012.02.21 93023
60 ajaxplorer 서버세팅 http://jekyung.com/139 2011.06.05 32238
59 apache2 재시작, 도메인 변경 방법 환경설정 vi /usr/local/apache2/conf/httpd.conf 도메인 수정 vi /usr/local/apache2/conf/extra/httpd-vhsots.conf 아파치 재실행 /usr/local/apache2/bin/apachestl restart 2013.07.01 30691
58 apm 버전 확인 명령어 rpm -qa | grep httpd rpm -qa | grep mysqld rpm -qa | grep php 2011.04.16 46746
57 apm 설치 yum 이용 1. APM(Apache + Php + Mysql) 설치 apache, mysql, php순으로 APM을 설치합니다. # yum -y install httpd # yum -y install mysql # yum -y install php 2. APM 관련 라이브러리 설치 # yum -y install gd gd-devel ... 2011.04.16 43681
56 autoset6 db 복원 import 시작 > 실행 > cmd 실행 cd autoset6servermysqlbin 이동후 c:autoset6servermysqlbin > 밑에 db 복원문 입력 mysql -u root(계정) -p jaggoowa(DB명) < /home/test/public_html/test.sql jaggoowa 라는 DB에 test.sq... 2011.07.16 42148
55 Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. 이런 에러 나올때 php.ini 파일을 연다 파일을 못찾을 경... 2011.07.24 34026
54 cband-status 자정 초기화 하기 vi /home/cband-reset.sh #!/bin/bash wget --http-user=아이디 --http-passwd=패스워드 'http://www.싸이트이름.com/cband-status?reset=all&refresh=15&unit=' 라는 스크립트를 만들어 줍니다. 여... 2016.02.20 67221
53 cband-status 페이지 암호화 하기 yum 으로 httpd 설치한 환경 입니다. vi /etc/httpd/conf/httpd.conf 에서 다음과 같이 수정해 줍니다. <IfModule mod_cband.c> <Location /cband-status> SetHandler cband-status AuthType Basic AuthName User Aut... 2016.02.20 2524
52 centos 7 apm + vsftpd 설치 스크립트 쉘(shell) 스크립트 다운로드 주소 : http://wooriagi.pe.hu/install.sh 웹기본 폴더는 /var/www/html 입니다. 그리고 /etc/httpd/conf/httpd.conf 에서 AllowOverride None 이 부분을 찾아 AllowOverride ALL로 바... file 2015.12.05 2912
51 centos eaccelerator 설치 방법 설치 소스 압축풀고 디렉토리로 이동해서 phpize ./configure make make install php.ini 설정 추가(eaccelerator.so 파일의 경로가 맞도록) extension="eaccelerator.so" eaccelerator.shm_size="16" eaccelerator.c... file 2012.01.04 42324
50 centos mysql-bin.000001 파일 용량 줄이기 명령어를 통해 mysql-bin.000001 와 같은 파일이 있는 곳으로 이동 합니다. cd /var/lib/mysql 이동을 하고 다음 명령어 입력 ls mysql-bin.* 그럼 bin 파일들이 나옵니다. 파일이 많으면 그만큼 용량이 차지 하기에 ... 2015.01.01 6065
49 CentOS RPM 버전 확인 명령어 rpm -qa httpd //버전 확인 rpm -qi httpd //더 상세한 패키지 정보 rpm -qa php rpm -qa mysql 2012.05.09 46453
48 centos ZendOptimizer 설치 방법 적당한 위치에서 압축을 풉니다 # tar zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz 3.3.9 버전부터는 이전버전의 install.sh 이 제공 되지 않습니다 일단 설치된 php버전을 확인합니다 # php -v PHP 5.2.... file 2012.01.04 42916
47 CentOS 버전 확인 lsb_release -a CentOS 버전 확인 lsb_release -a 혹은 다음 파일 중 하나를 열어 확인할 수 있다. /etc/issue /etc/redhat-release 2012.05.09 77101
46 centos 서버재시작 shoutdown -r now (1)shutdown shutdown 명령어는 시스템을 종료하거나 재부팅할 때 사용된다. 사용법 shutdown [옵션] [시간] [메세지] 옵션 -t n: 경고 메시지를 보낸 후 n초 후에 kill 시그널을 보낸다. -h : shutdown시 halt를 실... 2012.01.02 46951
45 Centos 설치방법 http://kch1183.blog.me/50099487610 추가, 파티션 나눌때 swap (가상메모리) 램 용량의 x 2 예) ram 2g , swap 4g 2011.04.16 31114
Board Pagination Prev 1 2 3 4 Next
/ 4