当我 cd 到目录时出现神秘错误消息“无法 stat.z.3222:没有这样的文件或目录”

当我 cd 到目录时出现神秘错误消息“无法 stat.z.3222:没有这样的文件或目录”

当我在命令行中导航到我的Downloads目录时,有时会出现以下消息:

~ $ cd Downloads
~/Downloads $ mv: cannot stat '/home/hardianlawi/z.3222': no such file or directory
~/Downloads $

有谁知道我该如何修复它,即如何防止它在我移动到Download文件夹时出现?

~ $ type -a cd
cd is a shell builtin

更新:

  • 这种情况只会偶尔出现,但每次出现的文件名都不同

运行set -x; cd Downloads输出

 ~  set -x
+omz_termsupport_precmd:1> emulate -L zsh                                       
+omz_termsupport_precmd:3> [[ '' == true ]]
+omz_termsupport_precmd:7> title '%15<..<%~%<<' '%n@%m: %~'
+title:1> emulate -L zsh
+title:2> setopt prompt_subst
+title:4> [[ '' == *term* ]]
+title:8> : '%n@%m: %~'
+title:10> case xterm-256color (cygwin | xterm*)
+title:12> print -Pn '\e]2;%n@%m:\ %~\a'
+title:13> print -Pn '\e]1;%15\<..\<%~%\<\<\a'
+_z_precmd:1> _z --add /home/hardianlawi
+_z:2> local datafile=/home/hardianlawi/.z
+_z:5> [ -h /home/hardianlawi/.z ']'
+_z:8> [ -z '' -a -f /home/hardianlawi/.z -a '!' -O /home/hardianlawi/.z ']'
+_z:20> [ --add '=' --add ']'
+_z:21> shift
+_z:24> [ /home/hardianlawi '=' /home/hardianlawi ']'
+_z:24> return
+/usr/bin/zsh:2> build_prompt
+build_prompt:1> RETVAL=0 
+build_prompt:2> prompt_status
+prompt_status:1> local symbols
+prompt_status:2> symbols=( ) 
+prompt_status:3> [[ 0 -ne 0 ]]
+prompt_status:4> [[ 1000 -eq 0 ]]
+prompt_status:5> [[+prompt_status:5> jobs -l
+prompt_status:5> [[+prompt_status:5> wc -l
+prompt_status:5> [[ 0 -gt 0 ]]
+prompt_status:7> [[ -n '' ]]
+build_prompt:3> prompt_virtualenv
+prompt_virtualenv:1> local virtualenv_path=''
+prompt_virtualenv:2> [[ -n '' ]]
+build_prompt:4> prompt_context
+build_prompt:5> prompt_dir
+prompt_dir:1> prompt_segment blue black '%~'
+prompt_segment:1> local bg fg
+prompt_segment:2> [[ -n blue ]]
+prompt_segment:2> bg='%K{blue}' 
+prompt_segment:3> [[ -n black ]]
+prompt_segment:3> fg='%F{black}' 
+prompt_segment:4> [[ NONE != NONE ]]
+prompt_segment:7> echo -n '%{%K{blue}%}%{%F{black}%} '
+prompt_segment:9> CURRENT_BG=blue 
+prompt_segment:10> [[ -n '%~' ]]
+prompt_segment:10> echo -n '%~'
+build_prompt:6> prompt_git
+prompt_git:1> ((  1  ))
+prompt_git:2> local PL_BRANCH_CHAR
+prompt_git:3> '(anon)'
+(anon):1> local LC_ALL='' LC_CTYPE=en_US.UTF-8
+(anon):2> PL_BRANCH_CHAR= 
+prompt_git:7> local ref dirty mode repo_path
+prompt_git:9> git rev-parse --is-inside-work-tree

+build_prompt:7> prompt_bzr
+prompt_bzr:1> ((  0  ))
+prompt_bzr:1> return
+build_prompt:8> prompt_hg
+prompt_hg:1> ((  0  ))
+prompt_hg:1> return
+build_prompt:9> prompt_end
+prompt_end:1> [[ -n blue ]]
+prompt_end:2> echo -n ' %{%k%F{blue}%}'
+prompt_end:6> echo -n '%{%f%}'
+prompt_end:7> CURRENT_BG='' 
 ~  cd Downloads 
+omz_termsupport_preexec:1> emulate -L zsh
+omz_termsupport_preexec:2> setopt extended_glob
+omz_termsupport_preexec:4> [[ '' == true ]]
+omz_termsupport_preexec:9> local CMD=cd
+omz_termsupport_preexec:10> local LINE='cd Downloads'
+omz_termsupport_preexec:12> title '$CMD' '%100>...>$LINE%<<'
+title:1> emulate -L zsh
+title:2> setopt prompt_subst
+title:4> [[ '' == *term* ]]
+title:8> : '%100>...>$LINE%<<'
+title:10> case xterm-256color (cygwin | xterm*)
+title:12> print -Pn '\e]2;%100\>...\>\$LINE%\<\<\a'
+title:13> print -Pn '\e]1;\$CMD\a'
+/usr/bin/zsh:2> cd Downloads
+autojump_chpwd:1> [[ -f /home/hardianlawi/.local/share/autojump/errors.log ]]
+autojump_chpwd:4> pwd
+autojump_chpwd:4> autojump --add /home/hardianlawi/Downloads
+omz_termsupport_precmd:1> emulate -L zsh                                       
+omz_termsupport_precmd:3> [[ '' == true ]]
+omz_termsupport_precmd:7> title '%15<..<%~%<<' '%n@%m: %~'
+title:1> emulate -L zsh
+title:2> setopt prompt_subst
+title:4> [[ '' == *term* ]]
+title:8> : '%n@%m: %~'
+title:10> case xterm-256color (cygwin | xterm*)
+title:12> print -Pn '\e]2;%n@%m:\ %~\a'
+title:13> print -Pn '\e]1;%15\<..\<%~%\<\<\a'
+_z_precmd:1> _z --add /home/hardianlawi/Downloads
+_z:2> local datafile=/home/hardianlawi/.z
+_z:5> [ -h /home/hardianlawi/.z ']'
+_z:8> [ -z '' -a -f /home/hardianlawi/.z -a '!' -O /home/hardianlawi/.z ']'
+_z:20> [ --add '=' --add ']'
+_z:21> shift
+_z:24> [ /home/hardianlawi/Downloads '=' /home/hardianlawi ']'
+_z:27> local exclude
+_z:28> exclude=
+_z:29> case /home/hardianlawi/Downloads (\*)
+_z:33> local tempfile=/home/hardianlawi/.z.16266
+_z:34> _z_dirs
+/usr/bin/zsh:3> build_prompt
+build_prompt:1> RETVAL=0 
+build_prompt:2> prompt_status
+prompt_status:1> local symbols
+prompt_status:2> symbols=( ) 
+prompt_status:3> [[ 0 -ne 0 ]]
+prompt_status:4> [[ 1000 -eq 0 ]]
+_z_dirs:1> local line
+_z_dirs:4> [ -d /home/hardianlawi/Downloads ']'
+_z_dirs:4> echo '/home/hardianlawi/Downloads|1050|1535445242'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /etc/systemd ']'
+_z_dirs:4> echo '/etc/systemd|2|1535098314'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/.oh-my-zsh ']'
+_z_dirs:4> echo '/home/hardianlawi/.oh-my-zsh|4|1529417140'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/.plotly ']'
+_z_dirs:4> echo '/home/hardianlawi/.plotly|7|1532058896'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/scripts/PythonPackages ']'
+_z_dirs:4> echo '/home/hardianlawi/scripts/PythonPackages|3|1528425308'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /etc/systemd/system ']'
+_z_dirs:4> echo '/etc/systemd/system|2|1535098301'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/anki-2.0.52 ']'
+_z_dirs:4> echo '/home/hardianlawi/anki-2.0.52|3|1531747714'
+_z_dirs:2> read line
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/.vim ']'
+_z_dirs:4> echo '/home/hardianlawi/.vim|5|1528771048'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/.config/sublime-text-3/Packages/SFTP ']'
+_z_dirs:4> echo '/home/hardianlawi/.config/sublime-text-3/Packages/SFTP|1|1529417461'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /tmp ']'
+_z_dirs:4> echo '/tmp|3|1535340515'
+_z_dirs:2> read line
+prompt_status:5> jobs -l
+_z_dirs:4> [ -d /home/hardianlawi/.config/sublime-text-3/Packages/Terminal ']'
+_z_dirs:4> echo '/home/hardianlawi/.config/sublime-text-3/Packages/Terminal|2|1529417221'
+prompt_status:5> wc -l
+_z_dirs:4> [ -d /home/hardianlawi/scripts ']'
+_z_dirs:4> echo '/home/hardianlawi/scripts|259|1535385308'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/.janus ']'
+_z_dirs:4> echo '/home/hardianlawi/.janus|4|1528275968'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /home/hardianlawi/.oh-my-zsh/themes ']'
+_z_dirs:4> echo '/home/hardianlawi/.oh-my-zsh/themes|21|1528508853'
+_z_dirs:4> [ -d /home/hardianlawi/scripts/easy-21 ']'
+_z_dirs:4> echo '/home/hardianlawi/scripts/easy-21|15|1535385578'
+_z_dirs:2> read line
+_z_dirs:4> [ -d /etc ']'
+_z_dirs:4> echo '/etc|42|1535099899'
+_z_dirs:2> read line
+prompt_status:5> [[ 0 -gt 0 ]]
+prompt_status:7> [[ -n '' ]]
+_z_dirs:4> [ -d '/home/hardianlawi/scripts/Probabilistic Graphical Models/PA-Simple-BN-Knowledge-Engineering-Release' ']'
+build_prompt:3> prompt_virtualenv
+_z_dirs:4> echo '/home/hardianlawi/scripts/Probabilistic Graphical Models/PA-Simple-BN-Knowledge-Engineering-Release|9|1528508988'
+_z_dirs:2> read line
+prompt_virtualenv:1> local virtualenv_path=''
+_z_dirs:6> return 0
+prompt_virtualenv:2> [[ -n '' ]]
+build_prompt:4> prompt_context
+build_prompt:5> prompt_dir
+prompt_dir:1> prompt_segment blue black '%~'
+prompt_segment:1> local bg fg
+prompt_segment:2> [[ -n blue ]]
+prompt_segment:2> bg='%K{blue}' 
+prompt_segment:3> [[ -n black ]]
+prompt_segment:3> fg='%F{black}' 
+prompt_segment:4> [[ NONE != NONE ]]
+prompt_segment:7> echo -n '%{%K{blue}%}%{%F{black}%} '
+prompt_segment:9> CURRENT_BG=blue 
+prompt_segment:10> [[ -n '%~' ]]
+prompt_segment:10> echo -n '%~'
+build_prompt:6> prompt_git
+_z:34> awk -v 'path=/home/hardianlawi/Downloads' -v 'now=1535445267' '-F|' $'\n            BEGIN {\n                rank[path] = 1\n                time[path] = now\n            }\n            $2 >= 1 {\n                # drop ranks below 1\n                if( $1 == path ) {\n                    rank[$1] = $2 + 1\n                    time[$1] = now\n                } else {\n                    rank[$1] = $2\n                    time[$1] = $3\n                }\n                count += $2\n            }\n            END {\n                if( count > 9000 ) {\n                    # aging\n                    for( x in rank ) print x "|" 0.99*rank[x] "|" time[x]\n                } else for( x in rank ) print x "|" rank[x] "|" time[x]\n            }\n        '
+prompt_git:1> ((  1  ))
+prompt_git:2> local PL_BRANCH_CHAR
+prompt_git:3> '(anon)'
+(anon):1> local LC_ALL='' LC_CTYPE=en_US.UTF-8
+(anon):2> PL_BRANCH_CHAR= 
+prompt_git:7> local ref dirty mode repo_path
+prompt_git:9> git rev-parse --is-inside-work-tree

+build_prompt:7> prompt_bzr
+prompt_bzr:1> ((  0  ))
+prompt_bzr:1> return
+build_prompt:8> prompt_hg
+prompt_hg:1> ((  0  ))
+prompt_hg:1> return
+build_prompt:9> prompt_end
+prompt_end:1> [[ -n blue ]]
+prompt_end:2> echo -n ' %{%k%F{blue}%}'
+prompt_end:6> echo -n '%{%f%}'
+prompt_end:7> CURRENT_BG='' 
+_z:58> [ 0 -ne 0 -a -f /home/hardianlawi/.z ']'
+_z:61> [ '' ']'
 ~/Downloads  +_z:62> env mv -f /home/hardianlawi/.z.16266 /home/hardianlawi/.z
+/usr/bin/zsh:3> build_prompt
+build_prompt:1> RETVAL=0 
+build_prompt:2> prompt_status
+prompt_status:1> local symbols
+prompt_status:2> symbols=( ) 
+prompt_status:3> [[ 0 -ne 0 ]]
+prompt_status:4> [[ 1000 -eq 0 ]]
+prompt_status:5> [[+prompt_status:5> jobs -l
+prompt_status:5> [[+prompt_status:5> wc -l
+prompt_status:5> [[ 0 -gt 0 ]]
+prompt_status:7> [[ -n '' ]]
+build_prompt:3> prompt_virtualenv
+prompt_virtualenv:1> local virtualenv_path=''
+prompt_virtualenv:2> [[ -n '' ]]
+build_prompt:4> prompt_context
+build_prompt:5> prompt_dir
+prompt_dir:1> prompt_segment blue black '%~'
+prompt_segment:1> local bg fg
+prompt_segment:2> [[ -n blue ]]
+prompt_segment:2> bg='%K{blue}' 
+prompt_segment:3> [[ -n black ]]
+prompt_segment:3> fg='%F{black}' 
+prompt_segment:4> [[ NONE != NONE ]]
+prompt_segment:7> echo -n '%{%K{blue}%}%{%F{black}%} '
+prompt_segment:9> CURRENT_BG=blue 
+prompt_segment:10> [[ -n '%~' ]]
+prompt_segment:10> echo -n '%~'
+build_prompt:6> prompt_git
+prompt_git:1> ((  1  ))
+prompt_git:2> local PL_BRANCH_CHAR
+prompt_git:3> '(anon)'
+(anon):1> local LC_ALL='' LC_CTYPE=en_US.UTF-8
+(anon):2> PL_BRANCH_CHAR= 
+prompt_git:7> local ref dirty mode repo_path
+prompt_git:9> git rev-parse --is-inside-work-tree

+build_prompt:7> prompt_bzr
+prompt_bzr:1> ((  0  ))
+prompt_bzr:1> return
+build_prompt:8> prompt_hg
+prompt_hg:1> ((  0  ))
+prompt_hg:1> return
+build_prompt:9> prompt_end
+prompt_end:1> [[ -n blue ]]
+prompt_end:2> echo -n ' %{%k%F{blue}%}'
+prompt_end:6> echo -n '%{%f%}'
+prompt_end:7> CURRENT_BG='' 

相关内容