본문 바로가기
코딩공부/etc..

day1

by 달빗슈 2020. 5. 25.

Rush- team project due to Sunday 11:42pm

 

Terminal -> ssh-keygen ( create directory)

 

/.ssh/id_rsa.

/.ssh/id_rsa.pub

 

Cat + keynote

 

Man ; manual

매뉴얼 검색하는 법

/ + 단어

Q 매뉴얼 종료

-f man : 

Ctrl + l : 다 지우기


Pwd : tell you where you are located in the filesystem

ls : see the content of our directory

ls -p : adding a slash to directories

ls -l : listing directory

ls -la : display hidden files

mkdir :  make directory

rmdir : remove directory

cd + ‘foldername’ : moved 


chmod

chmod는 해당 파일이나 디렉토리의 퍼미션(허용 권한)을 수정할 수 있는 명령어 입니다.
ls-al명령어를 치면 아래와 같은 결과가 출력되는데요, 여기서 맨 앞에 있는 rwxr-xr-x 이 9자리의 문자가 퍼미션과 관계가 있습니다. 참고로 9자리 문자의 앞에 있는 "d"는 디렉토리, "i"는 링크파일, "-"는 일반파일을 나타냅니다.

9자리를 표현하는 문자는 "r", "w", "x","-" 4가지가 있는데요, 각각 아래와 같은 뜻을 가집니다.

  • "r" : 읽기 권한
  • "w" : 쓰기 권한
  • "x" : 실행 권한
  • "-" : 권한 없음

그리고 9자리는 각각 3자리씩 나눠서 권한을 가지는 사용자가 구분되는데요, 그 구분은 아래와 같습니다.

  • 첫 3자리 : 소유자
  • 중간 3자리 : 그룹
  • 마지막 3자리 : 모든 사용자

위에서 나왔던 rwxr-xr-x를 예시로 보면, 소유자는 읽고, 쓰고, 실행할 수 있는 모든 권한(rwx)을 가졌고, 그룹과 모든 사용자는 읽고 실행할 수 있는 권한(r-x)을 가졌네요. 이 권한을 수정할 수 있는 방법은 아래와 같습니다.

chmod <변경될 퍼미션 값> <변경할 파일/디렉토리>

여기서 퍼미션 값이란, 각 문자를 숫자로 변환한 값(r=4, w=2, x=1)을 더한 값입니다. 예를 들어 rwx는 7, r-x는 5입니다. 이런식으로 각 그룹별로 끊어서 숫자를 입력하면 됩니다.

chmod 755 <변경할 파일/디렉토리> # 소유자는 모든 권한, 나머지는 읽고 실행할 수 있는 권한chmod 750 <변경할 파일/디렉토리> # 소유자는 모든 권한, 그룹은 읽고 실행할 수 있는 권한, 나머지는 아무 권한 없음

 


C언어의 출력은 printf();이지만 shell script에서는 echo로 나타낸다.

echo명령이 실행되고 나면 줄바꿈이 되어진다.

줄바꿈을 하지않고 출력하려면 echo -n 변수

 

 

 

<manual>

NAME

       man - format and display the on-line manual pages

 

SYNOPSIS

       man  [-acdfFhkKtwW]  [--path]  [-m system] [-p string] [-C config_file]

       [-M pathlist] [-P pager] [-B browser] [-H htmlpager] [-S  section_list]

       [section] name ...

 

DESCRIPTION

       man formats and displays the on-line manual pages.  If you specify sec-

       tion, man only looks in that section of the manual.  name  is  normally

       the  name of the manual page, which is typically the name of a command,

       function, or file.  However, if name contains  a  slash  (/)  then  man

       interprets  it  as a file specification, so that you can do man ./foo.5

       or even man /cd/foo/bar.1.gz.

 

       See below for a description of where man  looks  for  the  manual  page

       files.

 

OPTIONS

       -C  config_file

              Specify  the  configuration  file  to  use; the default is /pri-

man(1)                                                                  man(1)

 

NAME

       man - format and display the on-line manual pages

 

SYNOPSIS

       man  [-acdfFhkKtwW]  [--path]  [-m system] [-p string] [-C config_file]

       [-M pathlist] [-P pager] [-B browser] [-H htmlpager] [-S  section_list]

       [section] name ...

 

DESCRIPTION

       man formats and displays the on-line manual pages.  If you specify sec-

       tion, man only looks in that section of the manual.  name  is  normally

       the  name of the manual page, which is typically the name of a command,

       function, or file.  However, if name contains  a  slash  (/)  then  man

       interprets  it  as a file specification, so that you can do man ./foo.5

       or even man /cd/foo/bar.1.gz.

 

       See below for a description of where man  looks  for  the  manual  page

       files.

 

OPTIONS

       -C  config_file

              Specify  the  configuration  file  to  use; the default is /pri-

              vate/etc/man.conf.  (See man.conf(5).)

 

       -M  path

              Specify the list of directories to search for man pages.   Sepa-

              rate  the directories with colons.  An empty list is the same as

              not specifying -M at all.  See SEARCH PATH FOR MANUAL PAGES.

 

       -P  pager

              Specify which pager to use.  This option overrides the  MANPAGER

:...skipping...

man(1)                                                                  man(1)

 

반응형

'코딩공부 > etc..' 카테고리의 다른 글

[linux] 자주쓰는 명령어 정리  (0) 2020.05.31
shell 명령어  (0) 2020.05.27
day 03 shell01  (0) 2020.05.27
day2 ex00  (0) 2020.05.26
day1 EX00  (0) 2020.05.25

댓글