전자책 출간 알림 [마이크로서비스패턴 쉽게 개발하기]

티스토리 뷰

container로 실습하기

파일 관련

file [파일명]

file의 유형을 제공함

❯ file bulldok.zip
bulldok.zip: Zip archive data, at least v2.0 to extract

~/tmp master*
❯ file config.yaml
config.yaml: ASCII text

~/tmp master*
❯ file kubepia.pem
kubepia.pem: ASCII text, with very long lines

wc [파일명]

file의 라인수, 단어수, 문자수를 리턴

❯ cat test
Hello,
My name is ocean.
I'm glad to meet you.


~/tmp master*
❯ wc test
       4      10      49 test

head [-n line수] [파일명]

파일 내용의 처음부터 지정된 라인수 만큼 내용 리턴
라인 수 생략 시는 10줄 리턴

❯ head config.yaml
# Default values for openldap.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

# Define deployment strategy - IMPORTANT: use rollingUpdate: null when use Recreate strategy.
# It prevents from merging with existing map keys which are forbidden.
strategy: {}
  # type: RollingUpdate

tail [-n line수] [파일명]

파일 끝에서 지정된 라인수만큼 내용 리턴
라인수 생략시에는 10줄 리턴

❯ tail config.yaml

affinity: {}

## test container details
test:
  enabled: false
  image:
    repository: dduportal/bats
    tag: 0.4.0


디렉토리 이동

  • tilde : ~
    홈 디렉토리로 이동합니다.

    root@4df21a30c7ec:~/tmp/test# pwd
    /root/tmp/test
    root@4df21a30c7ec:~/tmp/test# cd ~
    root@4df21a30c7ec:~# pwd
    /root
    root@4df21a30c7ec:/var# pwd
    /var
    root@4df21a30c7ec:/var# cd
    
    /tmp/test
    root@4df21a30c7ec:
    
    /tmp/test# pwd
    /root/tmp/test
  • dash : - 
    이전에 있었던 디렉토리로 이동합니다.
root@4df21a30c7ec:/var# pwd
/var
root@4df21a30c7ec:/var# cd

/tmp/test
root@4df21a30c7ec:

/tmp/test# pwd
/root/tmp/test
root@4df21a30c7ec:~/tmp/test# cd -
/var
root@4df21a30c7ec:/var#

 

댓글

전자책 출간 알림 [마이크로서비스패턴 쉽게 개발하기]