Linux Basic

BASH

별다방체리콕 2024. 1. 9. 16:56

 

 

(GNU) Bash

사용자로부터 명령어를 입력받아 해석, 번역, 실행시켜주는 인터페이스 역할을 함

 

 

 

 

 

 

 

 

 

 

System Account

  • getent password

 

 

 

 

 

 

 

 

Environment Variable

  • PATH
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

 

  • HOME
    HOME=/root

 

 

 

 

 

 

 

 

Environment Variable files

  • /etc/profile
  • bashrc

 

 

 

 

 

 

 

 

Set Environment Variable

  • env
  • set
  • export

 

 

 

 

 

 

 

 

alias / source

  • alias
  • source/.

 

 

 

 

 

 

 

Shell Script

  • assign variable
    A=1, b=1
    C="Shell Script"
    D=$A
  • '
    A='Is /etc/profile'

  • echo
    echo $A

  • unset
    unset A

  • expr
    expr 1 + 1, expr 2 \* 2, expr 4 / 2, expr 4 % 2
    A='expr 1 + 1'

  • test, []
    test $A == $B
    echo $?

    [ $A == $B ]
    echo $?

    0: true, 1: false

  • $?
  • Relational Operators
    -rq, -ne, -gt, -lt, -ge, -le

  • Boolean Operators
    !, -o, -a

  • String Operators
    =, !=, -z, -n

  • File Test Operators
    -b, -c, -d, -f, -g

'Linux Basic' 카테고리의 다른 글

tar 명령어  (0) 2024.01.17
AWK  (0) 2024.01.10
OSI 7 Layer TCP/IP Model  (0) 2024.01.09
Never work the server remotely  (0) 2024.01.08
How to adminrate a server  (0) 2024.01.08