찾다
운영 및 유지보수리눅스 운영 및 유지 관리간단한 용어(코드 포함)로 Linux 및 MacOS 터미널의 대소문자 구분 문제에 대해 알아보세요.

이전 글 "새로 고침 없이 ajax 업로드 및 다운로드 구현을 설명하는 문서(자세한 코드 설명)"에서는 업로드 및 다운로드 새로 고침 없이 ajax 구현에 대해 알아보았습니다. 다음 기사는 Linux 및 MacOS 터미널의 대소문자 구분 문제를 이해하는 데 도움이 될 것입니다.

간단한 용어(코드 포함)로 Linux 및 MacOS 터미널의 대소문자 구분 문제에 대해 알아보세요.

Linux 및 MacOS 터미널에서는 대/소문자를 구분하지 않는다는 메시지가 표시됩니다.

터미널을 열고 사용자의 home 디렉터리로 cd하고 다음을 입력합니다. cd到用户home目录,输入:

echo "set completion-ignore-case on" >> .inputrc

关闭再重新打开终端即可

如果你只想快速解决上面的问题,直接看第三部分即可。

inputrc 文件介绍

Bash和其它大多数shell使用Readline库作为其输入相关的库。Readline库有一些默认的键盘映射,除此之外,也可以通过修改inputrc文件来定制键盘映射。

inputrc文件时Readline库的启动文件,当使用Readline作为输入库的程序启动时,它会自动读取inputrc配置文件,初始化自定义的键盘映射。

inputrc文件的位置由shell的环境变量INPUTRC控制,如果该变量没有设置,缺省的inputrc文件的路径是~/.inputrc

如果该文件~/.inputrc不存在,就会使用系统级(对所有用户生效)的inputrc文件/etc/inputrc。如果某个用户需要修改系统默认的 inputrc配置,可以改动~/.inputrc,这样会覆盖系统的默认配置。

关于如何编辑inputrc文件的信息,运行info bash,参考bashinfo页的Readline Init File这一节,运行info readline以参考readline自己的info页。

inputrc 配置

inputrc文件中,有两种配置:一种是inputrc变量,一种是键盘映射。 注意,在配置该文件时,注释必须占单独的一行,否则可能会有问题。

inputrc变量配置

变量配置的语法如下:

set variable value

常见的变量和配置如下:

completion-ignore-case
#如果设置为开(on),在自动补全时不区分大小写。该配置默认是关。

show-all-if-ambiguous
#这个配置该变了自动补全函数的默认行为。如果设置为开(on),当自动补全的结果有一个以上时,会直接列出这些结果。如果设置为关(off),就会提示一个beep蜂鸣声,当再按下tab时才会列出自动补全的结果。默认这项配置为关。

bell-style
#Controls what happens when Readline wants to ring the terminal bell. If set to ‘none’, Readline never rings the bell. If set to ‘visible’, Readline uses a visible bell if one is available. If set to ‘audible’ (the default), Readline attempts to ring the terminal's bell.

bind-tty-special-chars
#If set to ‘on’, Readline attempts to bind the control characters treated specially by the kernel's terminal driver to their Readline equivalents.

comment-begin
#The string to insert at the beginning of the line when the insert-comment command is executed. The default value is "#".
completion-prefix-display-length

#When set to a value greater than zero, common prefixes longer than this value are replaced with an ellipsis when displaying possible completions.
#e.g. set completion-prefix-display-length 4

completion-query-items
#The number of possible completions that determines when the user is asked whether the list of possibilities should be displayed. If the number of possible completions is greater than this value, Readline will ask the user whether or not he wishes to view them; otherwise, they are simply listed. This variable must be set to an integer value greater than or equal to 0. A negative value means Readline should never ask. The default limit is 100.

convert-meta
#If set to ‘on’, Readline will convert characters with the eighth bit set to an ascii key sequence by stripping the eighth bit and prefixing an <ESC> character, converting them to a meta-prefixed key sequence. The default value is ‘on’.

disable-completion
#If set to ‘On’, Readline will inhibit word completion. Completion characters will be inserted into the line as if they had been mapped to self-insert. The default is ‘off’.

editing-mode
#The editing-mode variable controls which default set of key bindings is used. By default, Readline starts up in Emacs editing mode, where the keystrokes are most similar to Emacs. This variable can be set to either ‘emacs’ or ‘vi’.

echo-control-characters
#When set to ‘on’, on operating systems that indicate they support it, readline echoes a character corresponding to a signal generated from the keyboard. The default is ‘on’.

enable-keypad
#When set to ‘on’, Readline will try to enable the application keypad when it is called. Some systems need this to enable the arrow keys. The default is ‘off’.

enable-meta-key
#When set to ‘on’, Readline will try to enable any meta modifier key the terminal claims to support when it is called. On many terminals, the meta key is used to send eight-bit characters. The default is ‘on’.

expand-tilde
#If set to ‘on’, tilde expansion is performed when Readline attempts word completion. The default is ‘off’.

history-preserve-point
#If set to ‘on’, the history code attempts to place the point (the current cursor position) at the same location on each history line retrieved with previous-history or next-history. The default is ‘off’.

history-size
#Set the maximum number of history entries saved in the history list. If set to zero, the number of entries in the history list is not limited.

horizontal-scroll-mode
#This variable can be set to either ‘on’ or ‘off’. Setting it to ‘on’ means that the text of the lines being edited will scroll horizontally on a single screen line when they are longer than the width of the screen, instead of wrapping onto a new screen line. By default, this variable is set to ‘off’.

input-meta
#If set to ‘on’, Readline will enable eight-bit input (it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The default value is ‘off’. The name meta-flag is a synonym for this variable.

isearch-terminators
#The string of characters that should terminate an incremental search without subsequently executing the character as a command. If this variable has not been given a value, the characters <ESC> and C-J will terminate an incremental search.

keymap
#Sets Readline&#39;s idea of the current keymap for key binding commands. Acceptable keymap names are emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command, and vi-insert. vi is equivalent to vi-command; emacs is equivalent to emacs-standard. The default value is emacs. The value of the editing-mode variable also affects the default keymap.

mark-directories
#If set to ‘on’, completed directory names have a slash appended. The default is ‘on’.

mark-modified-lines
#This variable, when set to ‘on’, causes Readline to display an asterisk (*) at the start of history lines which have been modified. This variable is ‘off’ by default.

mark-symlinked-directories
#If set to ‘on’, completed names which are symbolic links to directories have a slash appended (subject to the value of mark-directories). The default is ‘off’.

match-hidden-files
#This variable, when set to ‘on’, causes Readline to match files whose names begin with a ‘.’ (hidden files) when performing filename completion, unless the leading ‘.’ is supplied by the user in the filename to be completed. This variable is ‘on’ by default.

output-meta
#If set to ‘on’, Readline will display characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. The default is ‘off’.

page-completions
#If set to ‘on’, Readline uses an internal more-like pager to display a screenful of possible completions at a time. This variable is ‘on’ by default.

print-completions-horizontally
#If set to ‘on’, Readline will display completions with matches sorted horizontally in alphabetical order, rather than down the screen. The default is ‘off’.

revert-all-at-newline
If set to ‘on’, Readline will undo all changes to history lines before returning when accept-line is executed. By default, history lines can be modified and retain individual undo lists across calls to readline. The default is ‘off’.

show-all-if-unmodified
#This alters the default behavior of the completion functions in a fashion similar to show-all-if-ambiguous. If set to ‘on’, words which have more than one possible completion without any possible partial completion (the possible completions don&#39;t share a common prefix) cause the matches to be listed immediately instead of ringing the bell. The default value is ‘off’.

skip-completed-text
#If set to ‘on’, this alters the default completion behavior when inserting a single match into the line. It&#39;s only active when performing completion in the middle of a word. If enabled, readline does not insert characters from the completion that match characters after point in the word being completed, so portions of the word following the cursor are not duplicated. For instance, if this is enabled, attempting completion when the cursor is after the ‘e’ in ‘Makefile’ will result in ‘Makefile’ rather than ‘Makefilefile’, assuming there is a single possible completion. The default value is ‘off’.

visible-stats
#If set to ‘on’, a character denoting a file&#39;s type is appended to the filename when listing possible completions. The default is ‘off’.

键盘映射配置

配置inputrc变量的语法如下:

keyname: function-name or macro

#keyname必须是英文,可以是Control-u、Control-k等。并且keyname和冒号之间不能有空格,如果有空格会被认为是keyname的一部分。keyname的写法多样,取决于自己的喜好。
#下面是一些键盘映射配置的例子:

Control-u: universal-argument C-u is bound to the function universal-argument

Meta-Rubout: backward-kill-word M-DEL is bound to the function backward-kill-word

Control-o: "> output" C-o is bound to run the macro expressed on the right hand side (that is, to insert the text ‘> output’ into the line)

Control-j: menu-complete C-j is bound to cycle through the available tab completions.

Control-k: menu-complete-backward C-k is bound to cycle backwards through the available tab completions.

"\t": menu-complete Use tab to cycle through all the possible completions.

"\C-p": history-search-backward Map control-p to allow search for completions to the current line from your history. e.g. type “git” and then hit control-p to cycle through all the recent git commands.

"\ep": history-search-backward Map escape-p to allow search for completions to the current line from your history. e.g. type “git” and then hit escape-p to cycle through all the recent git commands.

"\e[A": history-search-backward Map Up arrow to allow search for completions to the current line from your history. e.g. type “git” and then hit UP to cycle through all the recent git commands.

"\e[B": history-search-forward Map Down arrow to allow search for completions to the current line from your history. e.g. type “git” and then hit DOWN to cycle back through all the recent git commands.

"\C-d": kill-whole-line Map control-d to kill the whole line.

设置MacOS下自动补全不区分大小写

通过上面的介绍,解决这个问题应该是绰绰有余了。打开用户主目录下的文件~/.inputrc(如果没有的话,就新建该文件),在其中添加如下配置:

# 设置自动补全不区分大小写
set completion-ignore-case on
# 当有一个以上自动补全结果时,直接列出,不用beep提示
set show-all-if-ambiguous on

保存该文件,然后,重启命令行,就会发现自动补全不区分大小写已经生效了。 网上好多结果中,还需要多加一个下面的配置:

TAB: menu-complete

这个配置的目的是,在列出自动补全的结果之后,再按一次tabrrreee

Close 그리고 다시 열어보세요 그냥 터미널을 이용하세요

위의 문제를 빠르게 해결하고 싶다면 세 번째 부분을 보시면 됩니다. inputrc 파일 소개

Bash 및 대부분의 다른 shell은 입력 관련 라이브러리로 Readline 라이브러리를 사용합니다. Readline 라이브러리에는 몇 가지 기본 키맵이 있습니다. 또한 inputrc 파일을 수정하여 키맵을 사용자 정의할 수도 있습니다. 🎜🎜inputrc 파일은 Readline 라이브러리의 시작 파일입니다. Readline을 입력 라이브러리로 사용하는 프로그램이 시작되면 자동으로 사용자 정의 키보드 매핑을 초기화하려면 inputrc 구성 파일을 읽어보세요. 🎜🎜inputrc 파일의 위치는 shell의 환경 변수 INPUTRC에 의해 제어됩니다. 이 변수가 설정되지 않은 경우 기본값은 inputrccode> 파일의 경로는 ~/.inputrc입니다. 🎜🎜~/.inputrc 파일이 존재하지 않으면 시스템 수준(모든 사용자에게 적용) inputrc 파일 /etc/inputrc > 사용됩니다. 사용자가 시스템의 기본 inputrc 구성을 수정해야 하는 경우 ~/.inputrc를 변경하여 시스템의 기본 구성을 덮어쓸 수 있습니다. 🎜🎜inputrc 파일 편집 방법에 대한 자세한 내용은 info bash를 실행하고 bashinfo 페이지를 참조하세요. > >Readline Init File 섹션에서 info readline을 실행하여 readline의 자체 info 페이지를 참조하세요. 🎜🎜inputrc 구성🎜🎜inputrc 파일에는 두 가지 구성이 있습니다. 하나는 inputrc 변수이고 다른 하나는 키보드 매핑입니다. 이 파일을 구성할 때 주석은 별도의 줄을 차지해야 합니다. 그렇지 않으면 문제가 발생할 수 있습니다. 🎜🎜inputrc 변수 구성🎜🎜변수 구성 구문은 다음과 같습니다. 🎜rrreee🎜공통 변수 및 구성은 다음과 같습니다. 🎜rrreee🎜키맵 구성🎜🎜Configurationinputrc 변수의 구문은 다음과 같습니다: 🎜rrreee🎜MacOS에서 자동 완성이 대소문자를 구분하지 않도록 설정🎜🎜위 소개를 통해 충분할 것입니다. 이 문제를 해결하기 위해. 사용자의 홈 디렉터리에서 ~/.inputrc 파일을 열고(없는 경우 새 파일 생성) 다음 구성을 추가합니다. 🎜rrreee🎜파일을 저장한 후 다시 시작합니다. 명령줄에서 자동 완성 대소문자 구분이 적용된 것으로 나타났습니다. 인터넷에 있는 많은 결과 중에서 다음 구성을 추가해야 합니다. 🎜rrreee🎜이 구성의 목적은 자동 완성 결과를 나열한 후 다시 tab 키를 누르면 자동으로 선택되도록 하는 것입니다. 항상 자동 완성 목록을 표시하는 대신 완성 목록에서. 🎜🎜추천 학습: 🎜Mac OS 입문 튜토리얼🎜, 🎜Linux 비디오 튜토리얼🎜🎜

위 내용은 간단한 용어(코드 포함)로 Linux 및 MacOS 터미널의 대소문자 구분 문제에 대해 알아보세요.의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
이 기사는 禅境花园에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제
유지 보수 모드 사용 : Linux 문제 해결 및 수리유지 보수 모드 사용 : Linux 문제 해결 및 수리Apr 29, 2025 am 12:28 AM

유지 보수 모드는 단일 사용자 모드 또는 구조 모드를 통해 Linux 시스템에 입력 된 특수 작동 수준이며 시스템 유지 관리 및 수리에 사용됩니다. 1. 유지 보수 모드를 입력하고 "sudosystemctlisolaterscue.target"명령을 사용하십시오. 2. 유지 보수 모드에서는 파일 시스템을 확인하고 수리하고 "FSCK/DEV/SDA1"명령을 사용할 수 있습니다. 3. 고급 사용법에는 루트 사용자 비밀번호 재설정, 파일 시스템을 읽기 및 쓰기 모드로 장착하고 비밀번호 파일을 편집하는 것이 포함됩니다.

리눅스 유지 보수 모드 : 목적 이해리눅스 유지 보수 모드 : 목적 이해Apr 28, 2025 am 12:01 AM

유지 보수 모드는 시스템 유지 보수 및 수리에 사용되므로 관리자는 단순화 된 환경에서 작업 할 수 있습니다. 1. 시스템 수리 : 손상된 파일 시스템 및 부트 로더 수리. 2. 비밀번호 재설정 : 루트 사용자 비밀번호를 재설정합니다. 3. 패키지 관리 : 소프트웨어 패키지를 설치, 업데이트 또는 삭제합니다. Grub 구성을 수정하거나 특정 키로 유지 보수 모드를 입력하면 유지 보수 작업을 수행 한 후 안전하게 종료 할 수 있습니다.

Linux 운영 : 네트워킹 및 네트워크 구성Linux 운영 : 네트워킹 및 네트워크 구성Apr 27, 2025 am 12:09 AM

Linux 네트워크 구성은 다음 단계를 통해 완료 할 수 있습니다. 1. 네트워크 인터페이스 구성 IP 명령을 사용하여 구성 파일 관리 설정을 일시적으로 설정하거나 편집하십시오. 2. 고정 IP가 필요한 장치에 적합한 정적 IP를 설정합니다. 3. 방화벽을 관리하고 IPTables 또는 방화구 도구를 사용하여 네트워크 트래픽을 제어하십시오.

Linux의 유지 관리 모드 : 시스템 관리자 안내서Linux의 유지 관리 모드 : 시스템 관리자 안내서Apr 26, 2025 am 12:20 AM

유지 보수 모드는 Linux 시스템 관리에서 중요한 역할을 수행하여 수리, 업그레이드 및 구성 변경을 돕습니다. 1. 유지 보수 모드를 입력하십시오. 그루브 메뉴를 통해 선택하거나 "sudosystemctlisolaterscue.target"명령을 사용할 수 있습니다. 2. 유지 보수 모드에서는 파일 시스템 수리 및 시스템 업데이트 작업을 수행 할 수 있습니다. 3. 고급 사용법에는 루트 비밀번호 재설정과 같은 작업이 포함됩니다. 4. 유지 보수 모드를 입력하거나 파일 시스템을 마운트 할 수없는 것과 같은 일반적인 오류는 Grub 구성을 확인하고 FSCK 명령을 사용하여 수정할 수 있습니다.

Linux의 유지 보수 모드 : 언제 및 왜 사용해야하는지Linux의 유지 보수 모드 : 언제 및 왜 사용해야하는지Apr 25, 2025 am 12:15 AM

Linux 유지 관리 모드 사용 타이밍 및 이유 : 1) 시스템이 시작될 때 2) 주요 시스템 업데이트 또는 업그레이드를 수행 할 때 3) 파일 시스템 유지 관리를 수행 할 때. 유지 보수 모드는 안전하고 제어 된 환경을 제공하여 운영 안전 및 효율성을 보장하고 사용자에게 미치는 영향을 줄이며 시스템 보안을 향상시킵니다.

Linux : 필수 명령 및 운영Linux : 필수 명령 및 운영Apr 24, 2025 am 12:20 AM

Linux의 필수 명령에는 다음이 포함됩니다. 1.LS : 목록 디렉토리 내용; 2.CD : 작업 디렉토리 변경; 3.mkdir : 새 디렉토리 생성; 4.RM : 파일 또는 디렉토리 삭제; 5.CP : 파일 또는 디렉토리 복사; 6.mv : 파일 또는 디렉토리를 이동하거나 바꾸십시오. 이러한 명령은 사용자가 커널과 상호 작용하여 파일 및 시스템을 효율적으로 관리하는 데 도움이됩니다.

Linux 작업 : 파일, 디렉토리 및 권한 관리Linux 작업 : 파일, 디렉토리 및 권한 관리Apr 23, 2025 am 12:19 AM

Linux에서 파일 및 디렉토리 관리는 LS, CD, MKDIR, RM, CP, MV 명령을 사용하며 권한 관리는 CHMOD, Chown 및 CHGRP 명령을 사용합니다. 1. 파일 및 디렉토리 관리 명령 LS-L 목록 상세 정보와 같은 MKDIR-P는 디렉토리를 재귀 적으로 생성합니다. 2. CHMOD755FILE SET 파일 권한 설정, ChownUserFile 변경 파일 소유자 및 CHGRPGROUPFILE와 같은 허가 관리 명령은 파일 그룹을 변경합니다. 이러한 명령은 파일 시스템 구조 및 사용자 및 그룹 시스템을 기반으로하며 시스템 호출 및 메타 데이터를 통해 작동 및 제어합니다.

Linux의 유지 관리 모드 란 무엇입니까? 설명했다Linux의 유지 관리 모드 란 무엇입니까? 설명했다Apr 22, 2025 am 12:06 AM

MaintenanceModeInlinlinlinuxisspecialbootenvernmentforcriticalsystemmaintenancetasks.itallowsAdministratorStorformtaskSlikeresettingpasswords, Repairingfilesystems, Andrecoveringfrombootfailuresinaminimalenvernment.toentermaintingancemode, intermainteancemode

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

Dreamweaver Mac版

Dreamweaver Mac版

시각적 웹 개발 도구

mPDF

mPDF

mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.

SublimeText3 Linux 새 버전

SublimeText3 Linux 새 버전

SublimeText3 Linux 최신 버전

Atom Editor Mac 버전 다운로드

Atom Editor Mac 버전 다운로드

가장 인기 있는 오픈 소스 편집기

PhpStorm 맥 버전

PhpStorm 맥 버전

최신(2018.2.1) 전문 PHP 통합 개발 도구