Linux: не в состоянии увидеть все параметры команды `tree`

293
iceman

Я пытаюсь перечислить содержимое каталога рекурсивно и в цвете, используя tree -Cкоманду. Тем не менее, моя оболочка сообщает об ошибке, и sedвместо этого отображается информационная запись для . Команда treeсама по себе работает нормально, но кажется, что некоторые параметры (например, tree -a) не доступны для меня.

Я пытался установить новую версию с помощью, sudo apt-get install treeно не повезло. Я испытываю это поведение в обоих bashи zsh(LXDE / Ubuntu 14.04).

Любые предложения, которые позволили бы мне использовать treeс полным набором параметров (перечислены здесь: http://linux.die.net/man/1/tree )?

~ tree -C ⏎ sed: invalid option -- 'C' Usage: sed [OPTION]... [input-file]...  -n, --quiet, --silent suppress automatic printing of pattern space -e script, --expression=script add the script to the commands to be executed -f script-file, --file=script-file add the contents of script-file to the commands to be executed --follow-symlinks follow symlinks when processing in place -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if SUFFIX supplied) -l N, --line-length=N specify the desired line-wrap length for the `l' command --posix disable all GNU extensions. -r, --regexp-extended use extended regular expressions in the script. -s, --separate consider files as separate rather than as a single continuous long stream. -u, --unbuffered load minimal amounts of data from the input files and flush the output buffers more often -z, --null-data separate lines by NUL characters --help display this help and exit --version output version information and exit  If no -e, --expression, -f, or --file option is given, then the first non-option argument is taken as the sed script to interpret. All remaining arguments are names of input files; if no input files are specified, then the standard input is read.  GNU sed home page: <http://www.gnu.org/software/sed/>. General help using GNU software: <http://www.gnu.org/gethelp/>. 
1

2 ответа на вопрос

1
dagrha

I don't have the reputation to comment, so I'll put this here.

It almost looks like the tree command is aliased to sed on your machine. When I run tree -C on my machine, I get the expected behavior. When I run sed -C on my computer, I get the exact same output that you get when you run tree -C.

Is there any entry in your ~/.bashrc file that defines an alias like that?

бинго. Некоторое время назад я добавил несколько предопределенных псевдонимов, о которых я забыл, в том числе один для `tree`. в то время я не знал о пакете `tree` для Ubunutu ... iceman 9 лет назад 0
0
Vangelis Mouhtsis

You can try the tree command as:

tree /boot/ tree -d /boot/ tree -C /boot/ 
Без дальнейшего объяснения это скорее комментарий, чем ответ. agtoever 9 лет назад 0

Похожие вопросы