
PROBLEM:
Ich habe die Installation durchgeführt sl
, aber wenn ich etwas sl
in die Befehlszeile eingebe, erhalte ich Folgendes:
bash: sl: command not found
(root@host)-(03:55:38)-(/home/user)
$apt install sl
Reading package lists... Done
Building dependency tree
Reading state information... Done
sl is already the newest version (3.03-17+b2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Sl ist ein Programm, das Animationen anzeigen kann, die Sie korrigieren sollen, wenn Sie versehentlich „sl“ eingeben. SL steht für Steam Locomotive (Steam Lokomotive). Paket zu Debian-Paketen
Installationsanweisungen auf cyberciti.biz/
Auszug:
Installieren Sie die SL-Software, um eine Dampflokomotive (Zug in der Shell) zu erhalten.
Geben Sie den folgenden apt-get-Befehl/apt-Befehl auf einem Debian
/ Ubuntu Linux ein:
$ sudo apt-get install sl
Verwendung
Okay, habe den Befehl ls einfach als sl falsch eingegeben:
$ sl
(root@host)-(03:57:47)-(/home/user)
$cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
(root@host)-(04:04:01)-(/home/user)
$bash -version
GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
FRAGE:
Was ist hier los, wo ist die Lok, muss ich da etwas konfigurieren ………?
Antwort1
Wenn Sie als ausführen root
(ich vermute, dass dies der Fall sein könnte, da Sie apt
direkt ausgeführt haben), PATH
wird standardmäßig /usr/local/games
und /usr/games
aufgrund einer Bedingung in ausgeschlossen /etc/profile
:
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
sl
ist zufällig in /usr/games
.