Trovare i symlinks corrotti in Linux

Mattepuffo's logo
Trovare i symlinks corrotti in Linux

Trovare i symlinks corrotti in Linux

Ho scoperto l'esistenza symlinks per Linux, che in pratica ci permette di individuare i symlinks corrotti e cancellarli.

Per installarlo su Debian:

# aptitude install symlinks

A questo punto potete lanciarlo cosi:

$ symlinks .

Questo cercherà i link nella directory corrente; se volete ricercare in maniera ricorsiva:

$ symlinks -r /etc
absolute: /etc/systemd/system/sshd.service -> /lib/systemd/system/ssh.service
absolute: /etc/systemd/system/syslog.service -> /lib/systemd/system/rsyslog.service
absolute: /etc/systemd/system/multi-user.target.wants/cups.path -> /lib/systemd/system/cups.path
absolute: /etc/systemd/system/multi-user.target.wants/irqbalance.service -> /lib/systemd/system/irqbalance.service
absolute: /etc/systemd/system/multi-user.target.wants/cups-browsed.service -> /lib/systemd/system/cups-browsed.service
absolute: /etc/systemd/system/multi-user.target.wants/NetworkManager.service -> /lib/systemd/system/NetworkManager.service
absolute: /etc/systemd/system/multi-user.target.wants/nscd.service -> /lib/systemd/system/nscd.service
absolute: /etc/systemd/system/multi-user.target.wants/atd.service -> /lib/systemd/system/atd.service
absolute: /etc/systemd/system/multi-user.target.wants/avahi-daemon.service -> /lib/systemd/system/avahi-daemon.service
absolute: /etc/systemd/system/multi-user.target.wants/php7.1-fpm.service -> /lib/systemd/system/php7.1-fpm.service
absolute: /etc/systemd/system/multi-user.target.wants/cron.service -> /lib/systemd/system/cron.service
absolute: /etc/systemd/system/multi-user.target.wants/wpa_supplicant.service -> /lib/systemd/system/wpa_supplicant.service
absolute: /etc/systemd/system/multi-user.target.wants/php7.2-fpm.service -> /lib/systemd/system/php7.2-fpm.service
absolute: /etc/systemd/system/multi-user.target.wants/rsyslog.service -> /lib/systemd/system/rsyslog.service
absolute: /etc/systemd/system/multi-user.target.wants/console-setup.service -> /lib/systemd/system/console-setup.service
absolute: /etc/systemd/system/multi-user.target.wants/rsync.service -> /lib/systemd/system/rsync.service
absolute: /etc/systemd/system/multi-user.target.wants/netdata.service -> /lib/systemd/system/netdata.service
absolute: /etc/systemd/system/multi-user.target.wants/pppd-dns.service -> /lib/systemd/system/pppd-dns.service
absolute: /etc/systemd/system/multi-user.target.wants/apache2.service -> /lib/systemd/system/apache2.service
absolute: /etc/systemd/system/multi-user.target.wants/unattended-upgrades.service -> /lib/systemd/system/unattended-upgrades.service
absolute: /etc/systemd/system/multi-user.target.wants/remote-fs.target -> /lib/systemd/system/remote-fs.target
absolute: /etc/systemd/system/multi-user.target.wants/ssh.service -> /lib/systemd/system/ssh.service
absolute: /etc/systemd/system/multi-user.target.wants/mariadb.service -> /lib/systemd/system/mariadb.service
absolute: /etc/systemd/system/multi-user.target.wants/anacron.service -> /lib/systemd/system/anacron.service
absolute: /etc/systemd/system/multi-user.target.wants/networking.service -> /lib/systemd/system/networking.service
absolute: /etc/systemd/system/multi-user.target.wants/ntp.service -> /lib/systemd/system/ntp.service
absolute: /etc/systemd/system/multi-user.target.wants/ModemManager.service -> /lib/systemd/system/ModemManager.service
absolute: /etc/systemd/system/mysqld.service -> /lib/systemd/system/mariadb.service
absolute: /etc/systemd/system/timers.target.wants/logrotate.timer -> /lib/systemd/system/logrotate.timer
absolute: /etc/systemd/system/timers.target.wants/anacron.timer -> /lib/systemd/system/anacron.timer
absolute: /etc/systemd/system/timers.target.wants/man-db.timer -> /lib/systemd/system/man-db.timer
absolute: /etc/systemd/system/timers.target.wants/phpsessionclean.timer -> /lib/systemd/system/phpsessionclean.timer
absolute: /etc/systemd/system/timers.target.wants/apt-daily.timer -> /lib/systemd/system/apt-daily.timer
absolute: /etc/systemd/system/timers.target.wants/apt-daily-upgrade.timer -> /lib/systemd/system/apt-daily-upgrade.timer
absolute: /etc/systemd/system/display-manager.service -> /lib/systemd/system/lightdm.service
absolute: /etc/systemd/system/printer.target.wants/cups.service -> /lib/systemd/system/cups.service
absolute: /etc/systemd/system/sockets.target.wants/avahi-daemon.socket -> /lib/systemd/system/avahi-daemon.socket
absolute: /etc/systemd/system/sockets.target.wants/cups.socket -> /lib/systemd/system/cups.socket
absolute: /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service -> /lib/systemd/system/NetworkManager-wait-online.service
absolute: /etc/systemd/system/network-online.target.wants/networking.service -> /lib/systemd/system/networking.service
absolute: /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service -> /lib/systemd/system/wpa_supplicant.service
absolute: /etc/systemd/system/getty.target.wants/getty@tty1.service -> /lib/systemd/system/getty@.service
absolute: /etc/systemd/system/dbus-org.freedesktop.ModemManager1.service -> /lib/systemd/system/ModemManager.service
absolute: /etc/systemd/system/mysql.service -> /lib/systemd/system/mariadb.service
absolute: /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service -> /lib/systemd/system/NetworkManager-dispatcher.service
absolute: /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service -> /lib/systemd/system/systemd-timesyncd.service
absolute: /etc/systemd/system/sysinit.target.wants/apparmor.service -> /lib/systemd/system/apparmor.service
absolute: /etc/systemd/system/sysinit.target.wants/keyboard-setup.service -> /lib/systemd/system/keyboard-setup.service
absolute: /etc/systemd/system/dbus-org.freedesktop.Avahi.service -> /lib/systemd/system/avahi-daemon.service
absolute: /etc/systemd/system/graphical.target.wants/rtkit-daemon.service -> /lib/systemd/system/rtkit-daemon.service
absolute: /etc/systemd/system/graphical.target.wants/udisks2.service -> /lib/systemd/system/udisks2.service
absolute: /etc/systemd/system/graphical.target.wants/accounts-daemon.service -> /lib/systemd/system/accounts-daemon.service
/etc/polkit-1/localauthority: Permission denied
..................

Avendolo lanciato con utente normale, non abbiamo accesso a tutto.

Se volete anche cancellarli:

$ symlinks -dr .

Enjoy!


Share this Post

Commentami!