cd 显示 macOS 中的文件和文件夹列表

cd 显示 macOS 中的文件和文件夹列表

最近我更新了 macOS 和终端,以下是详细信息

  • 苹果系统塞拉10.12.6
  • 命令行工具版本9.0

现在,每当我cd在终端中运行时,它都会导航到该目录并自动列出所有我不想要的目录结构(默认)。

我该如何修复它?我认为罪魁祸首可能是别名,但不知道如何修复它,这是我的 bash_profile 设置。

的〜/ .bash_profile

alias cp='cp -iv'                           # Preferred 'cp' implementation
alias mv='mv -iv'                           # Preferred 'mv' implementation
alias mkdir='mkdir -pv'                     # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp'                       # Preferred 'ls' implementation
alias less='less -FSRXc'                    # Preferred 'less' implementation
cd() { builtin cd "$@"; ll; }               # Always list directory contents upon 'cd'
alias cd..='cd ../'                         # Go back 1 directory level (for fast typers)
alias ..='cd ../'                           # Go back 1 directory level
alias ...='cd ../../'                       # Go back 2 directory levels
alias .3='cd ../../../'                     # Go back 3 directory levels
alias .4='cd ../../../../'                  # Go back 4 directory levels
alias .5='cd ../../../../../'               # Go back 5 directory levels
alias .6='cd ../../../../../../'            # Go back 6 directory levels
alias edit='subl'                           # edit:         Opens any file in sublime editor
alias f='open -a Finder ./'                 # f:            Opens current directory in MacOS Finder
alias ~="cd ~"                              # ~:            Go Home
alias c='clear' 
alias qfind="find . -name "                 # qfind:    Quickly search for file
ff () { /usr/bin/find . -name "$@" ; }      # ff:       Find file under the current directory
ffs () { /usr/bin/find . -name "$@"'*' ; }  # ffs:      Find file whose name starts with a given string
ffe () { /usr/bin/find . -name '*'"$@" ; }  # ffe:      Find file whose name ends with a given string
alias psgrep='ps aux | grep '

答案1

在您的 .bash_profile 文件中,您已设置cd为始终显示目录内容。

注释该行

cd() { builtin cd "$@"; ll; } # Always list directory contents upon 'cd'

以避免这种行为。

相关内容