반응형
    
    
    
  tee 명령어
1. sudo tee -a 사용 (권장)
cat <<EOF | sudo tee -a /etc/security/limits.conf > /dev/null
# Add parameter for WebServer
*               soft    nofile          65535
*               hard    nofile          65535
*               soft    nproc           unlimited
*               hard    nproc           unlimited
EOF2. 직접 파일 수정
sudo cat <<EOF >> /etc/security/limits.conf
# Add parameter for WebServer
*               soft    nofile          65535
*               hard    nofile          65535
*               soft    nproc           unlimited
*               hard    nproc           unlimited
EOF더보기
---
sudo bash -c 'cat <<EOF >> /etc/security/limits.conf
# Add parameter for WebServer
*               soft    nofile          65535
*               hard    nofile          65535
*               soft    nproc           unlimited
*               hard    nproc           unlimited
EOF'---
3. 명령어를 스크립트화
#!/bin/bash
LIMITS_FILE="/etc/security/limits.conf"
sudo tee -a "$LIMITS_FILE" > /dev/null <<EOF
# Add parameter for WebServer
*               soft    nofile          65535
*               hard    nofile          65535
*               soft    nproc           unlimited
*               hard    nproc           unlimited
EOF
echo "Updated $LIMITS_FILE successfully."
첫 번째 명령어(sudo tee -a) 방식이 더 안전하고 오류를 방지하며 권한 문제 해결에 유리합니다.
참고URL
- 변군이글루 블로그(Byeon-gun's Igloo Blog) : tee 명령어
728x90
    
    
  반응형
    
    
    
  '리눅스' 카테고리의 다른 글
| PHP-FPM Pool을 구성하는 방법 (1) | 2025.01.14 | 
|---|---|
| NGINX에서 가상 호스트에 HTTP2를 설정하는 방법 (0) | 2025.01.08 | 
| 우분투에 PHP rdkafka 확장 모듈을 설치하는 방법 (0) | 2025.01.07 | 
| 우분투에서 이미지를 WebP 이미지로 변환하는 방법 (0) | 2024.12.31 | 
| Zabbix 알림을 Slack과 연동하는 방법 (0) | 2024.12.23 | 
 
                  
                 
                  
                 
                  
                