기본 콘텐츠로 건너뛰기

Linux Terminal Commands




File Permissions
  • chmod 777 – read, write, execute for all 
  • chmod 755 – rwx for owner, rx for group and world 
File Commands 
  • ls -al – Formatted listing with hidden files 
  • mkdir dir – Create a directory dir 
  • rm name – Remove a file or directory called name 
  • rm -rf dir – Force remove an entire directory dir and all it’s included files and subdirectories (use with extreme caution) 
  • cp -r dir1 dir2 – Copy dir1 to dir2; create dir2 if it doesn't exist 
  • cp file /home/dirname – Copy the filename called file to the /home/dirname directory 
  • scp -p 22 file user@host.com:/home/ - Secure Copy file to host.com /home directory as user through port 22 
  • mv file /home/dirname – Move the file called filename to the /home/dirname directory 
  • ln -s file link – Create symbolic link link to file 
  • cat originFile > targetFile – Places standard input into new file (not work on ssh) 
  • cat originFile >> targetFile - add string to file
Compression
  • tar xzf file.tar.gz – Extract a tar using Gzip 
Network
  • wget -c file – Continue a stopped download 
SSH
  • ssh user@host – Connect to host as user 
User Administration
  • adduser accountname – Create a new user call accountname 
Process Management
  • ps – Display your currently active processes 
  • kill pid – Kill process id pid 
Stopping & Starting
  • halt – Stop all processes - same as above 
  • reboot – Stop all processes and then reboot - same as above 
  • shutdown -r 5 – Shutdown the system in 5 minutes and reboot 
systemd
  • systemctl start servicename - start servicename service 
  • systemctl enable servicename - registration service 
  • systemctl status servicename - show service status 



http://community.linuxmint.com/tutorial/view/244


이 블로그의 인기 게시물

Docker 요약

Docker 요약 기본 명령어 시작 명령어 및 시작 옵션 (run: pull, create, start) docker run [OPTION] [IMAGE:tag] [COMMAND] [ARGS...] [OPTION] -d detached mode (백그라운드) --name 컨테이너 이름 설정 -it interactive, terminal -p 포트 연결 ( -p HostPort:ContainerPort ) -P EXPOSE된 모든 포트를 연결한다. 이미지 삭제 docker rmi [IMAGE_NAME] 모든 컨테이너 보기 docker ps -a 종료된 모든 컨테이너 삭제 docker rm $(docker ps -a -q) 컨테이너에서 특정 명령 실행 docker exec [OPTION] [CONTAINER_NAME] [COMMAND] 데이터 볼륨 마운트 (예: MySql) docker run -v /my/own/hostDir:/var/lib/mysql mysql:5.7 Dockerfile 이미지 생성을 위한 설정 파일. 이 파일이 있는 디렉토리에서 Docker build 실행 시 이 파일을 기반으로 이미지 빌드. FROM : 기반 이미지 파일 (FROM mariadb/server) USER : 아래 RUN 명령어를 실행할 유저 지정 (USER root) RUN : 터미널 명령 실행. 이미지 빌드 때 실행 (RUN apt-get update) WORKDIR : 터미널에서의 작업 경로 설정 (WORKDIR /etc) ENTRYPOINT : 터미널 명령 실행. 컨테이너 실행 시 실행 (ENTRYPOINT ./npm) CMD : 터미널 명령 실행. 컨테이너 실행 시 실행. 어플 실행, ENTRYPOINT의 파라메터 등에 쓰임 (CMD [“executable”,“param1”,“param2”] - ENTRYPOINT가 설정되어 있으면 [“param1”,“param2”]...

Docker Tutorial (Docker Toolbox)

https://www.docker.com/products/overview 설치파일 다운로드. 내 맥북은 가상화를 지원하지 않는 CPU를 가진 2009년형. 그래서 Docker for Mac 사용불가하여 Docker Toolbox 설치. mkdir yourdockerbuild cd yourdockerbuild touch Dockerfile nano Dockerfile FROM imageNameOnHub:version - 불러올 이미지 RUN *** - 최초 실행할 명령 (설치명령 등. image 안에 설치됨) CMD *** - 이미지가 로딩되면 실행할 명령 docker build -t yourImageName . docker run yourImageName 추가로 hub를 통하지 않고 Image를 이동 하려면 Docker Registry 사용 도커 레지스트리 (Docker Registry) 설치하기 + S3 연동