尝试在.bashrc中添加命令时找不到命令消息 [英] command not found message when I try to add command in .bashrc

查看:98
本文介绍了尝试在.bashrc中添加命令时找不到命令消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在问如何在bash shell中编写精美优雅的linux命令的问题

当我尝试建议时,收到以下错误消息.

And when I tried the suggestion, I got the following error message.

Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:    12.10
Codename:   quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

这是我目前在.bashrc中写的内容

This is what I currently write in my .bashrc

source .bashrc
export LC_CTYPE="utf-8"
function go_app() { cd /var/virtual/$1/; }

这是我的/var/www目录

Here is my /var/www directory

www-data@ubuntu:~$ ls -la
total 52
drwxr-xr-x  5 www-data www-data  4096 Nov  9 15:03 .
drwxr-xr-x 15 root     root      4096 Nov  8 09:51 ..
-rw-------  1 www-data www-data 19657 Nov  7 23:24 .bash_history
-rwxr-xr-x  1 www-data www-data    82 Nov  9 15:03 .bashrc
drwx------  2 www-data www-data  4096 Aug  7 19:28 .cache
drwxrwxr-x  3 www-data www-data  4096 Aug  9 19:19 .composer
-rw-------  1 www-data www-data     6 Aug  8 11:48 .mysql_history
-rw-------  1 root     root        50 Nov  9 15:08 .nano_history
drwxrwxr-x  2 www-data www-data  4096 Aug  7 20:19 .ssh

新.bashrc

export LC_CTYPE="en_US.utf8"
function go_app() { cd /var/virtual/$1/; }

错误消息:

go_app: command not found

推荐答案

这应该可以解决对不起,找不到命令已崩溃!..."问题:

This should fix the "Sorry, command-not-found has crashed!..." issue:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8 # sudo required on ubuntu 20.04
sudo dpkg-reconfigure locales

这篇关于尝试在.bashrc中添加命令时找不到命令消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆