2008/11/13 Marce <[EMAIL PROTECTED]>

> 2008/11/13 Jonatan Alballay <[EMAIL PROTECTED]>:
> > Hola lista es posible listar los servicios por consola ejemplo un ls -l a
> la
> > carptera rc3.d lo cual me arroja lo siguiente:
> >
> > lrwxrwxrwx 1 root root  18 2008-11-12 22:45 cupsys -> /etc/init.d/cupsys
> > lrwxrwxrwx 1 root root  19 2008-10-22 12:49 K20oracle-xe ->
> > ../init.d/oracle-xe
> > lrwxrwxrwx 1 root root  15 2008-10-22 12:49 K21mysql -> ../init.d/mysql
> > lrwxrwxrwx 1 root root  19 2008-10-22 12:49 K22mysql-ndb ->
> > ../init.d/mysql-ndb
> > lrwxrwxrwx 1 root root  20 2008-10-23 17:56 K77ntp-server ->
> > ../init.d/ntp-server
> > lrwxrwxrwx 1 root root  21 2008-11-12 22:45 oracle-xe ->
> > /etc/init.d/oracle-xe
> > lrwxrwxrwx 1 root root  18 2008-10-21 11:57 S10sysklogd ->
> > ../init.d/sysklogd
> > lrwxrwxrwx 1 root root  15 2008-10-21 11:57 S11klogd -> ../init.d/klogd
> > lrwxrwxrwx 1 root root  15 2008-10-21 11:57 S20acpid -> ../init.d/acpid
> > lrwxrwxrwx 1 root root  19 2008-10-22 12:49 S20alsasound ->
> > ../init.d/alsasound
> > lrwxrwxrwx 1 root root  22 2008-11-06 17:20 S20cpufrequtils ->
> > ../init.d/cpufrequtils
> > lrwxrwxrwx 1 root root  14 2008-10-21 09:53 S20dbus -> ../init.d/dbus
> > lrwxrwxrwx 1 root root  17 2008-11-06 01:19 S20dirmngr ->
> ../init.d/dirmngr
> > lrwxrwxrwx 1 root root  22 2008-10-24 16:33 S20hotkey-setup ->
> > ../init.d/hotkey-setup
> > lrwxrwxrwx 1 root root  17 2008-10-21 11:56 S20makedev ->
> ../init.d/makedev
> > lrwxrwxrwx 1 root root  17 2008-10-23 00:41 S20mplayer ->
> ../init.d/mplayer
> > lrwxrwxrwx 1 root root  15 2008-10-21 19:18 S20no-ip -> ../init.d/no-ip
> > lrwxrwxrwx 1 root root  23 2008-10-21 10:05 S20nvidia-kernel ->
> > ../init.d/nvidia-kernel
> > lrwxrwxrwx 1 root root  23 2008-10-21 11:57 S20openbsd-inetd ->
> > ../init.d/openbsd-inetd
> > lrwxrwxrwx 1 root root  20 2008-10-25 20:16 S20pulseaudio ->
> > ../init.d/pulseaudio
> > lrwxrwxrwx 1 root root  13 2008-10-21 09:54 S21gdm -> ../init.d/gdm
> > lrwxrwxrwx 1 root root  14 2008-10-21 11:56 S89cron -> ../init.d/cron
> > lrwxrwxrwx 1 root root  18 2008-10-21 11:56 S99rc.local ->
> > ../init.d/rc.local
> > lrwxrwxrwx 1 root root  19 2008-10-21 11:56 S99rmnologin ->
> > ../init.d/rmnologin
> > lrwxrwxrwx 1 root root  23 2008-10-21 11:56 S99stop-bootlogd ->
> > ../init.d/stop-bootlogd
> >
> > Lo que necesito es solo que me liste el la ultima palabra despues de /
> ej:
> > stop-bootlogd y quitar todo lo demas, como se trata de un directorio no
> se
> > puede usar tail ni cut, como lo puedo hacer? me pueden ayudar... de ante
> > mano gracias.
> >
>
> Se que no se deberia dar la solución y se deberia leer mas...pero
> bueno. Asi a bote pronto con esto se hace:
>
> ls -al /etc/rc3.d/|awk -F / '{print $3}'
>
> Con AWK y SED se hacen muchas de estas cosas.
>
> Saludos
>
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
> [EMAIL PROTECTED]
>
>
Con cut seria otra opción.

Un Saludo

Responder a