차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linuxfromscratch [2025/12/18 17:40] – [설치된 Perl Module 목록 확인] baecylinuxfromscratch [2026/03/22 02:03] (현재) baecy
줄 1: 줄 1:
-===== 토막 상식 =====+~~NOTOC~~ 
 +==== 토막 상식 ==== 
 +=== Git 특정 디렉터리 또는 파일만 클론 === 
 +<codeprism lang=bash> 
 +# 1. 깃 저장소를 초기화 
 +mkdir firefox-l10n && cd firefox-l10n 
 +git init
  
-==== 설치된 Perl Module 목록 확인 ==== +# 2. 원격 저장소 등록 
-=== Perl과 기본 시스템 도구만 이용 ===+git remote add -f origin https://github.com/mozilla-l10n/firefox-l10n.git 
 + 
 +# 3. Sparse Checkout 활성화 
 +git sparse-checkout init --cone 
 + 
 +# 4. 대상 지정 
 +git sparse-checkout set ko 
 + 
 +# 5. 적용 
 +git pull origin main 
 +</codeprism> 
 +=== Nvidia Driver 설치후에도 적용이 안되는 경우 확인 === 
 +현재 드라이버 버전 확인 및 조치 \\ 
 +로그인 가능한 다른 VT로 전환 후 다음과 같이 진행 
 +<codeprism lang=bash cmdout=2> 
 +nvidia-smi --version | grep -i driver 
 +DRIVER version      : 590.48.01 
 +sudo -s  
 +mkdir -pv /usr/lib/firmware/nvidia/590.48.01 
 +cp /usr/src/NVIDIA-Linux-x86_64-590.48.01/firmware/* \ 
 +   /usr/lib/firmware/nvidia/590.48.01 
 +modprobe -r -f nvidia 
 +modprobe nvidia 
 +systemdctl restart sddm</codeprism> 
 +==== Meson Bash-completion 수정 ==== 
 +meson에서 환경변수가 tab completion이 안되는 경우.\\ 
 +/usr/share/bash-completion/completions/meson 
 +<codeprism lang=bash> 
 +#complete -F _meson meson 
 +complete -o default -o bashdefault -F _meson meson 
 +</codeprism> 
 + 
 +=== Bash 토막 상식 === 
 +<codeprism lang=bash> 
 +# 인자가 비어있으면 미리 지정된 값 할당 
 +TARGET_ARCH=${LFS_TARGET:-x86_64-lfs-linux-gnu} 
 +# 인자 내용에서 확장자 제거 
 +FILE="ffmpeg-8.0.1.tar.xz" 
 +DIR_NAME=${FILE%.tar*} # DIR_NAME="ffmpeg-8.0.1" 
 +# 변수 내용 치환 
 +SAFE_NAME=${RAW_NAME// /_} # " " -> "_" 
 +# 경로인 경우 조작 
 +# ## 왼쪽부터 가장 먼 "/" 까지 삭제. 두번 사용해서 최대한 길게 적용. 
 +# %  오른쪽부터 처음 나온 "/" 까지 삭제. 두번 사용하면 가장 왼쪽의 "/" 까지 삭제 
 +PATH="/usr/lib/pkgconfig/sdl3.pc" 
 +echo ${PATH##*/ # 마지막 / 앞부분을 다 날림 -> sdl3.pc 
 +echo ${PATH%/*}   # 마지막 / 뒷부분을 다 날림 -> /usr/lib/pkgconfig 
 +</codeprism> 
 + 
 +=== pkgconf로 설치된 라이브러리 확인 === 
 +Bash Script 
 +<codeprism lang=bash> 
 +### Check installed packages 
 +TARGET="" 
 + 
 +### merge args 
 +for UARGS in "$@"; do  
 +        TARGET="${TARGET}|${UARGS}" 
 +done 
 + 
 +### remove first "|' 
 +TARGET="${TARGET#|}" 
 + 
 +### '-print0' and 'xargs -0' for file name with white space 
 +find /usr/lib/pkgconfig -name "*.pc" | \ 
 +        grep -Ei "${TARGET}" | \ 
 +        xargs -0 pkgconf --print-provides 
 +</codeprism> 
 +Ruby Script 
 +<codeprism lang=ruby> 
 +#!/usr/bin/env ruby 
 + 
 +# 1. 인자 처리 
 +target = ARGV.empty? ? "." : ARGV.join('|'
 + 
 +# 2. 파일 목록 가져오기 및 패키지명 추출 
 +search_path = "/usr/lib/pkgconfig/*.pc" 
 + 
 +# .pc 확장자를 제외한 파일 이름(패키지명)만 추출하여 필터링 
 +package_names = Dir.glob(search_path).map do |file| 
 +  File.basename(file, ".pc") # "/usr/lib/pkgconfig/zlib.pc" -> "zlib" 
 +end.select do |pkg| 
 +  pkg =~ Regexp.new(target, Regexp::IGNORECASE) 
 +end 
 + 
 +# 3. pkgconf 실행 
 +if package_names.any? 
 +  # 패키지명을 나열하여 실행 
 +  # 예: pkgconf --print-provides zlib libpng 
 +  system("pkgconf", "--print-provides", *package_names) 
 +else 
 +  puts "매칭되는 패키지가 없습니다." 
 +end 
 +</codeprism> 
 + 
 +=== 마이크로코드 Grub auto detect === 
 +AMD 5800X 기준 
 +<codeprism lang=bash cmdout=4-12> 
 +sudo -s 
 +cp /usr/lib/firmware/amd-ucode/microcode_amd_fam19h.bin /boot/amd-ucode.img 
 +grub-mkconfig -o /boot/grub/grub.cfg 
 +Generating grub configuration file ... 
 +Found theme: /usr/share/grub/themes/starfield/theme.txt 
 +Found linux image: /boot/vmlinuz-6.18.10-1st 
 +Found initrd image: /boot/amd-ucode.img 
 +Warning: os-prober will not be executed to detect other bootable partitions. 
 +Systems on them will not be added to the GRUB boot configuration. 
 +Check GRUB_DISABLE_OS_PROBER documentation entry. 
 +Adding boot menu entry for UEFI Firmware Settings ... 
 +done</codeprism>  
 + 
 +=== 설치된 Perl Module 목록 확인 === 
 +== Perl과 기본 시스템 도구만 이용 ==
 <codeprism bash> <codeprism bash>
 #!/bin/sh #!/bin/sh
줄 35: 줄 153:
 이런 방식으로 다중 검색도 가능함. 이런 방식으로 다중 검색도 가능함.
  
-=== ExtUtils::Install module 이용 ===+== ExtUtils::Install module 이용 ==
 <codeprism bash> <codeprism bash>
 #!/bin/sh #!/bin/sh
줄 81: 줄 199:
 버전을 출력해주는 장점이 있음. \\ 버전을 출력해주는 장점이 있음. \\
 특정 모듈 설치전에는 사용하기 힘들다는 단점이 있음. 특정 모듈 설치전에는 사용하기 힘들다는 단점이 있음.
-==== 설치된 Python3 Module 목록 확인 ====+ 
 +=== 설치된 Python3 Module 목록 확인 ===
  
 <codeprism bash> <codeprism bash>
줄 87: 줄 206:
 </codeprism> </codeprism>
  
-==== Qemu Screen Dump ===+=== Qemu Screen Dump ===
   - <Ctrl>+<Alt>+<2> 그래픽 모드 \\ <Ctrl>+<A>, <C> -nographic 모드 \\ 모니터 콘솔로 전환   - <Ctrl>+<Alt>+<2> 그래픽 모드 \\ <Ctrl>+<A>, <C> -nographic 모드 \\ 모니터 콘솔로 전환
   - screendump __filename.ppm__ \\ 다음과 같이 **-f** 옵션으로 저장 포맷 지정 가능 \\ screendump screenshot.png -f png \\ 포맷 지정 저장 방식에서 세그폴트 발생하면 ppm으로 저장후 변환   - screendump __filename.ppm__ \\ 다음과 같이 **-f** 옵션으로 저장 포맷 지정 가능 \\ screendump screenshot.png -f png \\ 포맷 지정 저장 방식에서 세그폴트 발생하면 ppm으로 저장후 변환
   - <Ctrl>+<Alt>+<1> 가상 머신 화면 복귀   - <Ctrl>+<Alt>+<1> 가상 머신 화면 복귀
  
- +=== xwindow screen saver & dpms 시간 설정 ===
-==== xwindow screen saver & dpms 시간 설정 ===+
 <codeprism bash> <codeprism bash>
 xset s 600 600 xset s 600 600
줄 102: 줄 218:
 순서대로 \\ 순서대로 \\
 화면보호기 작동시간,전환시간\\ 화면보호기 작동시간,전환시간\\
-DPMS 대기,유예,끄기 \\ +DPMS 대기,유예,끄기 
- +
-==== for, echo and sed =====+
  
 +=== for, echo and sed ====
 <code bash> <code bash>
 for i in $(echo "ldapadd, ldapcompare, ldapdelete, ldapexop, ldapmodify, slapschema, slaptest" | sed 's/,/ /g') ; do find /usr/bin -type f -name $i ; done for i in $(echo "ldapadd, ldapcompare, ldapdelete, ldapexop, ldapmodify, slapschema, slaptest" | sed 's/,/ /g') ; do find /usr/bin -type f -name $i ; done
 </code> </code>
-==== Grep && Tar ==== 
  
 +=== Grep && Tar ===
 특정 문자열을 가진 파일을 아카이브 처리 특정 문자열을 가진 파일을 아카이브 처리
  
줄 129: 줄 244:
   * f 아카이브 파일명   * f 아카이브 파일명
  
----- +=== Configure Options #1 ===
-==== Configure Options #1 ===+
 사용해본 결과 생각처럼 편한것은 아니었음. 사용해본 결과 생각처럼 편한것은 아니었음.
  
줄 179: 줄 292:
 ++++ ++++
  
----- 
 ==== Find script ==== ==== Find script ====
 +<wrap hi>위쪽에 Bash & Ruby 스크립트 사용</wrap>
 패키지 설치 여부가 생각나지 않을 때 사용 패키지 설치 여부가 생각나지 않을 때 사용
  
줄 189: 줄 301:
 사용 예시 \\ 사용 예시 \\
 {{:linuxfromscratch:스크린샷_2024-05-28_191051.png |}} {{:linuxfromscratch:스크린샷_2024-05-28_191051.png |}}
- 
  
 <code bash> <code bash>
줄 204: 줄 315:
 </code> </code>
  
----- +=== Patch with Wget ===
- +
-==== Patch with Wget ===+
 <code> <code>
 wget -q -O- <patch url> | patch <options> wget -q -O- <patch url> | patch <options>
 </code> </code>
- +== 사용법 === 
-=== 사용법 ===  +예시 1
- +
-== 예시 1 ==+
  
 docbook-xsl-nons-1.79.2 patch docbook-xsl-nons-1.79.2 patch
- 
 <code lang=bash> <code lang=bash>
 wget -q -O- https://www.linuxfromscratch.org/patches/blfs/12.1/docbook-xsl-nons-1.79.2-stack_fix-1.patch \ wget -q -O- https://www.linuxfromscratch.org/patches/blfs/12.1/docbook-xsl-nons-1.79.2-stack_fix-1.patch \
줄 223: 줄 328:
 </code> </code>
  
-== 예시 2 ==+예시 2
  
 libpng patch libpng patch
줄 231: 줄 336:
 </code> </code>
  
----- +=== PS1 설정 === 
-==== PS1 설정 ====+일반사용자 
 +<codeprism bash>\[\033[01;34m\]\u\[\033[00m\]@\[\033[01;36m\]\h \[\033[01;34m\]\w\[\033[00m\] \$ </codeprism> 
 +루트사용자 
 +<codeprism bash>\[\033[01;35m\]\u\[\033[00m\]@\[\033[01;35m\]\h \[\033[01;37m\]\w \[\033[01;31m\]# \[\033[00m\]</codeprism>
  
-=== 최초 === +== 2차 개선 == 
- +++++ 별거아닌데 쓸데없이 길어짐
-++++ 이 지저분하고 번거로움 +<code bash> 
-<code lang=bash cmd=true user=root+PS1_ROOT='\[$(tput setaf 203)\][ \[$(tput sgr0)\]\w \[$(tput setaf 203)\]] \[$(tput sgr0)\]\$\n' 
-touch $LFS/etc/lfs-chroot</code>\\ +PS1_USER='\[$(tput setaf 75)\]\[$(tput sgr0)\]\\[$(tput setaf 75)\]\[$(tput sgr0)\]\$\n' 
-~/.bashrc\\ +PS1_HEAD='\[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\h ' 
-<code lang=bash> +if [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ] ; then 
-if -f /etc/lfs-chroot ]; then +    if [ $(id -u) -eq 0 ] ; then 
-  PS1='\[$(tput setaf 75)\]<LFS> \[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\\[$(tput setaf 75)\]\\[$(tput sgr0)\]\$\n'+        PS1="<Chroot>${PS1_HEAD}${PS1_ROOT}" 
 +    else 
 +        PS1="<Chroot>${PS1_HEAD}${PS1_USER}" 
 +    fi
 else else
-  PS1='\[$(tput setaf 75)\]\[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\h \[$(tput setaf 75)\]\w \[$(tput sgr0)\]\$\n' +    if [ $(id -u) -eq 0 ; then 
-fi</code>\\+        PS1="${PS1_HEAD}${PS1_ROOT}" 
 +    else 
 +        PS1="${PS1_HEAD}${PS1_USER}" 
 +    fi 
 +fi 
 +</code>
 ++++ ++++
- +== 1차 개선 ==
-=== 1차 개선 ==+
 ++++ 번거로운건 사라짐 그러나 여전히 지저분함 | ++++ 번거로운건 사라짐 그러나 여전히 지저분함 |
 <code lang=bash> <code lang=bash>
줄 265: 줄 379:
 </code> </code>
 ++++ ++++
- +최초 
-=== 2차 개선 === +++++ 많이 지저분하고 번거로움 | 
- +<code lang=bash cmd=true user=root> 
-<code bash> +touch $LFS/etc/lfs-chroot</code>\\ 
-PS1_ROOT='\[$(tput setaf 203)\][ \[$(tput sgr0)\]\w \[$(tput setaf 203)\]] \[$(tput sgr0)\]\$\n' +~/.bashrc\\ 
-PS1_USER='\[$(tput setaf 75)\]\[$(tput sgr0)\]\\[$(tput setaf 75)\]\[$(tput sgr0)\]\$\n' +<code lang=bash> 
-PS1_HEAD='\[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\h ' +if -f /etc/lfs-chroot ]; then 
-if [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ] ; then +  PS1='\[$(tput setaf 75)\]<LFS> \[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\\[$(tput setaf 75)\]\\[$(tput sgr0)\]\$\n'
-    if [ $(id -u) -eq 0 ] ; then +
-        PS1="<Chroot>${PS1_HEAD}${PS1_ROOT}" +
-    else +
-        PS1="<Chroot>${PS1_HEAD}${PS1_USER}" +
-    fi+
 else else
-    if [ $(id -u) -eq 0 ; then +  PS1='\[$(tput setaf 75)\]\[$(tput setaf 229)\]\u\[$(tput setaf 199)\]@\[$(tput setaf 215)\]\h \[$(tput setaf 75)\]\w \[$(tput sgr0)\]\$\n' 
-        PS1="${PS1_HEAD}${PS1_ROOT}" +fi</code>\\ 
-    else +++++
-        PS1="${PS1_HEAD}${PS1_USER}" +
-    fi +
-fi +
-</code> +
 ---- ----
-==== Debian 설치 후 추가적인 사항 ===+=== Debian 설치 후 추가적인 사항 ===
 LFS 진행에 필요한 패키지 설치 LFS 진행에 필요한 패키지 설치
  
줄 301: 줄 404:
 ---- ----
 ==== 화면 출력 로그파일로 저장 ==== ==== 화면 출력 로그파일로 저장 ====
- 
 <code lang=bash> <code lang=bash>
 time { command 1 && ... && command N; } 2>&1 | tee <log-file> time { command 1 && ... && command N; } 2>&1 | tee <log-file>
 </code> </code>
  
----- 
 ==== Qemu에서 부팅중 마운트 에러가 발생하는 경우 ==== ==== Qemu에서 부팅중 마운트 에러가 발생하는 경우 ====
- 
 Qemu에서 가상머신 시작시 디바이스 순서가 바뀌는 일이 발생해서 처리한 내용. Qemu에서 가상머신 시작시 디바이스 순서가 바뀌는 일이 발생해서 처리한 내용.
  
 파티션 레이블 설정 파티션 레이블 설정
- 
 <code lang=bash> <code lang=bash>
 mkswap -L <label> <partition> mkswap -L <label> <partition>
줄 319: 줄 418:
  
 ''/etc/fstab'' 수정 ''/etc/fstab'' 수정
- 
 <code lang=bash> <code lang=bash>
 # /etc/fstab: static file system information. # /etc/fstab: static file system information.
줄 339: 줄 437:
 LABEL=LFS_DISK          /mnt/lfs        ext4            defaults                1       1 LABEL=LFS_DISK          /mnt/lfs        ext4            defaults                1       1
 </code> </code>
- 
 UUID로 설정하는 경우 장치명을 주석으로 표기하면 추후 수정시 용이. UUID로 설정하는 경우 장치명을 주석으로 표기하면 추후 수정시 용이.
  
----- +=== Putty에서 Ncurses 설치 후 <Home>,<End> Key 사용 설정 ===
-==== Putty에서 Ncurses 설치 후 <Home>,<End> Key 사용 설정 ===+
 ~/.profie or ~/.bashrc ~/.profie or ~/.bashrc
  
줄 352: 줄 447:
 </code> </code>
  
----- +=== Glibc-2.35 Compile ===
-==== Glibc-2.35 Compile ====+
 컴파일중 알 수 없는 에러가 발생하고 매번 발생 위치가 다르다면 -j1 인자로 병렬처리 없이 make 실행 컴파일중 알 수 없는 에러가 발생하고 매번 발생 위치가 다르다면 -j1 인자로 병렬처리 없이 make 실행
 <code cmd=true lang=bash> <code cmd=true lang=bash>
 make -j1</code> make -j1</code>
-\\ + 
-==== LFS로 Booting후 ''su'' 명령이 안되는 경우 ====+=== LFS로 Booting후 ''su'' 명령이 안되는 경우 ===
 //''root''//로 다음과 같이 실행 //''root''//로 다음과 같이 실행
 <code lang=bash> <code lang=bash>
 chmod 4755 /usr/bin/su</code> chmod 4755 /usr/bin/su</code>
 ''su'' 파일에 setuid를 설정해서 묹제를 해결. ''su'' 파일에 setuid를 설정해서 묹제를 해결.
-\\ \\ + 
-==== LFS로 부팅하기 전에 준비할 것들 ==== +=== LFS로 부팅하기 전에 준비할 것들 === 
-=== OpenSSH ===+== OpenSSH ==
 [[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/openssh.html|OpenSSH]] [[https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/openssh.html|OpenSSH]]
- +== Wget ==
-=== Wget ==+
 소스 패키지 다운로드에 필요  소스 패키지 다운로드에 필요 
- 
 [[https://www.linuxfromscratch.org/blfs/view/systemd/basicnet/wget.html|Wget-1.24.5]]  [[https://www.linuxfromscratch.org/blfs/view/systemd/basicnet/wget.html|Wget-1.24.5]] 
  
줄 392: 줄 483:
 ++++ ++++
  
-=== NFS-UTILS ==+== NFS-UTILS ==
 [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/nfs-utils.html|NFS-Utils-2.6.4]] [[https://www.linuxfromscratch.org/blfs/view/stable-systemd/basicnet/nfs-utils.html|NFS-Utils-2.6.4]]
  
줄 406: 줄 496:
 ++++ ++++
  
-=== SSHFS (NFS 사용 안하는 경우)==+== SSHFS (NFS 사용 안하는 경우)==
 N40L에 있는 소스 디렉토리 마운트에 필요 N40L에 있는 소스 디렉토리 마운트에 필요
  
줄 432: 줄 521:
 ++++ ++++
  
----- +=== Textinfo Dir File Rebuild ===
- +
-==== Textinfo Dir File Rebuild ===+
 <code lang=bash> <code lang=bash>
 pushd /usr/share/info pushd /usr/share/info
줄 445: 줄 531:
 </code> </code>
  
----- +=== Swap file ===
-==== Swap file ===+
 <code cmd=true cmdout=6,7> <code cmd=true cmdout=6,7>
 export LFS=/mnt/lfs export LFS=/mnt/lfs
줄 460: 줄 544:
 </code> </code>
  
----- +=== Binutils 설치하기 전에 ISL 설치하기 ===
-==== Binutils 설치하기 전에 ISL 설치하기 ===+
 GMP를 먼저 설치  GMP를 먼저 설치 
- 
 <code lang=bash> <code lang=bash>
 ./configure --prefix=/usr    \ ./configure --prefix=/usr    \
줄 474: 줄 555:
 awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
 </code> </code>
- 
 [[https://libisl.sourceforge.io/|ISL Homepage]]에서 받아서 준비 [[https://libisl.sourceforge.io/|ISL Homepage]]에서 받아서 준비
- 
 <code lang=bash> <code lang=bash>
 ./configure --prefix=/usr --disable-static --with-gmp=system ./configure --prefix=/usr --disable-static --with-gmp=system
줄 483: 줄 562:
 </code> </code>
  
----- +=== $LFS/sources에서 디렉토리 검색 ===
- +
-==== $LFS/sources에서 디렉토리 검색 ====+
 가장 간단한 방법 가장 간단한 방법
 <code lang=bash> <code lang=bash>
 ls -d */ ls -d */
 </code> </code>
- 
 <code lang=bash> <code lang=bash>
 alias dirfind="find -mindepth 1 -maxdepth 1 -type d | sed 's@^./@@'" alias dirfind="find -mindepth 1 -maxdepth 1 -type d | sed 's@^./@@'"
줄 499: 줄 575:
 </code> </code>
  
----- +=== SBU 측정 ===
-==== SBU 측정 ====+
 <code lang=bash> <code lang=bash>
 ## 현재 디렉토리+생성시간을 추가해서 로그파일 작성 ## 현재 디렉토리+생성시간을 추가해서 로그파일 작성
줄 506: 줄 581:
 time { ./configure .... && make && make install; } | lfslog </code>\\ time { ./configure .... && make && make install; } | lfslog </code>\\
  
-==== 짜투리 ====+=== 짜투리 ===
 <code lang=html> <code lang=html>
 <a href=""></a>                                           ## 현재 창 또는 탭에서 링크 열기 <a href=""></a>                                           ## 현재 창 또는 탭에서 링크 열기
줄 525: 줄 600:
  
 ## Same Command  ## Same Command 
- 
 ./configure --prefix=/usr --bindir=/usr/bin --localstatedir=/var \ ./configure --prefix=/usr --bindir=/usr/bin --localstatedir=/var \
             --disable-{logger,whois,r{cp,exec,login,sh},servers}</code>\\             --disable-{logger,whois,r{cp,exec,login,sh},servers}</code>\\
  
-==== tar를 이용한 복사 ====+=== tar를 이용한 복사 ===
 <code lang=bash> <code lang=bash>
 tar -cf - . | tar -xvf - -C /target_directory</code>\\ tar -cf - . | tar -xvf - -C /target_directory</code>\\
  
-==== find example ====+=== find example ===
 <code lang=bash> <code lang=bash>
 ## 크기가 50M 이상이면서 .deb, .vmdk 확장자가 아닌 파일  ## 크기가 50M 이상이면서 .deb, .vmdk 확장자가 아닌 파일 
줄 539: 줄 613:
 find /media/d/ -type f -size +50M -and ! -name "*deb" -and ! -name "*vmdk"</code>\\ find /media/d/ -type f -size +50M -and ! -name "*deb" -and ! -name "*vmdk"</code>\\
  
-==== grep example ====+=== grep example ===
 <code lang=bash> <code lang=bash>
 ## 일반적인 grep 으로 다음과 같은 결과가 나왔다. ## 일반적인 grep 으로 다음과 같은 결과가 나왔다.
줄 583: 줄 657:
 #!/usr/bin/env python3    # 변경 </code>\\ #!/usr/bin/env python3    # 변경 </code>\\
  
-==== Gawk ====+=== Gawk ===
 <code lang=bash> <code lang=bash>
 df -ht ext4 df -ht ext4
줄 594: 줄 668:
 /dev/sdc1       1.8T   28K  1.7T   1% /mnt/3rd-bay /dev/sdc1       1.8T   28K  1.7T   1% /mnt/3rd-bay
 /dev/sdd1       1.8T   32K  1.7T   1% /mnt/4th-bay</code>\\ /dev/sdd1       1.8T   32K  1.7T   1% /mnt/4th-bay</code>\\
- 
 <code lang=bash> <code lang=bash>
 # 읽어들인 NR 레코드(여기서는 Filesystem과 Size) 갯수가 2 이하일때는 awk에서 바로 출력하고  # 읽어들인 NR 레코드(여기서는 Filesystem과 Size) 갯수가 2 이하일때는 awk에서 바로 출력하고 
줄 608: 줄 681:
 /dev/sde2        19G  1.5G   16G   9% /mnt/debian</code>\\ /dev/sde2        19G  1.5G   16G   9% /mnt/debian</code>\\
  
-참고  
 <code lang=bash> <code lang=bash>
 # 1q로 한줄만 sed에서 처리하고 종료 나머지는 sort가 처리 # 1q로 한줄만 sed에서 처리하고 종료 나머지는 sort가 처리
줄 622: 줄 694:
 /dev/sde2        19G  1.5G   16G   9% /mnt/debian</code>\\ /dev/sde2        19G  1.5G   16G   9% /mnt/debian</code>\\
  
-==== wget ====+=== wget ===
 <code lang=bash> <code lang=bash>
 # -r / --recursive : 디렉토리 대상 # -r / --recursive : 디렉토리 대상
줄 630: 줄 702:
 wget -r -np -R "index.html*" -P <DIR> lfs/ https://ftp.osuosl.org/pub/lfs/lfs-packages/12.1/</code>\\ wget -r -np -R "index.html*" -P <DIR> lfs/ https://ftp.osuosl.org/pub/lfs/lfs-packages/12.1/</code>\\
  
-==== Firmware Blob Kernel config ====+=== Firmware Blob Kernel config ===
 <code lang=bash> <code lang=bash>
 echo CONFIG_EXTRA_FIRMWARE='" '$({ cd /lib/firmware; echo amd-ucode/*; echo amdgpu/re*; echo rtl_nic/*; echo regulatory*; })'"' >> .config echo CONFIG_EXTRA_FIRMWARE='" '$({ cd /lib/firmware; echo amd-ucode/*; echo amdgpu/re*; echo rtl_nic/*; echo regulatory*; })'"' >> .config
 make oldconfig make oldconfig
-</code> \\+</code>
  
-==== Man page count ====+=== Man page count ===
 <code lang=bash> <code lang=bash>
 find /usr/share/man/ -type f -name '*.[0-9]' | wc -l find /usr/share/man/ -type f -name '*.[0-9]' | wc -l
-</code> \\ +</code>
  • linuxfromscratch.1766079631.txt.gz
  • 마지막으로 수정됨: 2025/12/18 17:40
  • 저자 baecy