HARAP DICATAT: Untuk melihat komentar tentang hal ini dan diskusi panjang tentang ini, yang mencakup semua yang telah dicoba, silakan lihat di ruang obrolan ini .
Hari ini ketika saya menjalankan cat
perintah, alih-alih isi file, saya mendapatkan:
Hello, nothing to see here! Move along!
Saya telah memeriksa untuk memastikan bahwa cat
file tidak berubah setelah terakhir kali saya menggunakannya, jadi saya yakin bahwa file cat /bin
belum diubah, jadi sesuatu yang lain harus dijalankan ketika saya mengetik cat
, alih-alih cat
program yang tepat ... Tapi saya tidak melihat bagaimana itu bisa terjadi ...
Jadi saya pikir saya harus bertanya di sini tentang hal itu, jadi, mengapa ini terjadi dan bagaimana saya bisa memperbaikinya?
Pembaruan Informasi:
Saya telah memeriksa .bash_aliases
file saya , dan tidak ada cat
alias, juga tidak ada dalam .bashrc
file saya yang menunjuk ke alias yang benar.
Output dari strings $(command -v cat)
adalah:
#!/bin/bash
echo "Hello, nothing to see here! Move along!"
Output dari type cat
adalah:
cat is /bin/cat
The sha256sum
file cat
adalah:
a80c46f9c73190d6b46bdf444ade76d05ce113a21dbab7b805dde5027816aa48
Output dari strace cat
adalah:
execve("/bin/cat", ["cat"], [/* 61 vars */]) = 0
brk(0) = 0x1833000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b44e000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=122452, ...}) = 0
mmap(NULL, 122452, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0f0b430000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\v\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1869392, ...}) = 0
mmap(NULL, 3972864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0f0ae63000
mprotect(0x7f0f0b023000, 2097152, PROT_NONE) = 0
mmap(0x7f0f0b223000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f0f0b223000
mmap(0x7f0f0b229000, 16128, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b229000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b42f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b42e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b42d000
arch_prctl(ARCH_SET_FS, 0x7f0f0b42e700) = 0
mprotect(0x7f0f0b223000, 16384, PROT_READ) = 0
mprotect(0x60b000, 4096, PROT_READ) = 0
mprotect(0x7f0f0b450000, 4096, PROT_READ) = 0
munmap(0x7f0f0b430000, 122452) = 0
brk(0) = 0x1833000
brk(0x1854000) = 0x1854000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=5418528, ...}) = 0
mmap(NULL, 5418528, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0f0a938000
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0
fadvise64(0, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
mmap(NULL, 139264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f0b40b000
read(0,
Hal lain yang saya perhatikan adalah bahwa masalah ini tidak mempengaruhi pengguna lain pada sistem.
echo $PATH
output:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/neo/jdk1.8.0_45/bin
Output dari printenv
adalah:
XDG_VTNR=7
XDG_SESSION_ID=c2
CLUTTER_IM_MODULE=xim
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/neo
SESSION=ubuntu
GPG_AGENT_INFO=/run/user/1000/keyring/gpg:0:1
TERM=xterm
SHELL=/bin/bash
VTE_VERSION=3803
WINDOWID=81788939
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1640
GNOME_KEYRING_CONTROL=
GTK_MODULES=overlay-scrollbar:unity-gtk-module
USER=neo
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/neo/jdk1.8.0_45/bin
DESKTOP_SESSION=ubuntu
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=appmenu-qt5
XDG_SESSION_TYPE=x11
JOB=unity-settings-daemon
PWD=/home/neo
XMODIFIERS=@im=ibus
GNOME_KEYRING_PID=
LANG=en_GB.UTF-8
GDM_LANG=en_GB
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
IM_CONFIG_PHASE=1
COMPIZ_CONFIG_PROFILE=ubuntu
JAVA_TOOL_OPTIONS=-javaagent:/usr/share/java/jayatanaag.jar
GDMSESSION=ubuntu
SESSIONTYPE=gnome-session
XDG_SEAT=seat0
HOME=/home/neo
SHLVL=1
LANGUAGE=en_GB:en
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
UPSTART_INSTANCE=
UPSTART_EVENTS=xsession started
XDG_SESSION_DESKTOP=ubuntu
LOGNAME=neo
COMPIZ_BIN_PATH=/usr/bin/
QT4_IM_MODULE=xim
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9BqFSNNHkf
LESSOPEN=| /usr/bin/lesspipe %s
INSTANCE=
UPSTART_JOB=unity7
XDG_RUNTIME_DIR=/run/user/1000
DISPLAY=:0
XDG_CURRENT_DESKTOP=Unity
GTK_IM_MODULE=ibus
LESSCLOSE=/usr/bin/lesspipe %s %s
HISTTIMEFORMAT=%d/%m/%y %T
XAUTHORITY=/home/neo/.Xauthority
_=/usr/bin/printenv
Informasi OS:
Description: Ubuntu 15.04
Release: 15.04
Informasi Paket:
coreutils:
Installed: 8.23-3ubuntu1
Candidate: 8.23-3ubuntu1
Version table:
*** 8.23-3ubuntu1 0
500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
100 /var/lib/dpkg/status
cat
perintah biner jelas telah digantikan oleh bash
skrip ( strings
perintah) ... sehingga Anda mungkin memiliki "teman" yang memiliki password root?
cat
dari shell lain seperti dash
, apakah masih menampilkan output aneh?