Inicio·Comandos de terminal
Publicidad

Consigue tu bono en un exchange de criptomonedas

Bonos que recibes solo por registrarte. Las condiciones son las que publica cada exchange.

type

Procesos y sistema

Uso

type [-a] <name>

Pregunta al propio shell que es realmente un nombre: alias, funcion, builtin o archivo, justo lo que `which` no ve porque solo mira PATH.

Opciones habituales

OpciónSignificado
-aEvery meaning of the name, in the order the shell would consider them.
-tOne word only: alias, keyword, function, builtin or file.
-PForce a PATH lookup even if the name is also an alias or function (bash).
-fIgnore shell functions.

Ejemplos

type -a ls

Reveals the alias first and the /bin/ls binary second.

type -t rm

Prints "file" if nothing is shadowing it, "alias" if something is.

Qué se está ejecutando y qué se come la máquina. Identificarlo va antes de matarlo.

Cómo leerlo

  • Los corchetes [ ] marcan una parte que puedes omitir.
  • Los puntos suspensivos … indican que puedes poner varios.
  • Las opciones distinguen mayúsculas: en algunos comandos -r y -R no hacen lo mismo.

Preguntas

Q¿Qué hace type?

Pregunta al propio shell que es realmente un nombre: alias, funcion, builtin o archivo, justo lo que `which` no ve porque solo mira PATH.

Q¿Cómo se escribe?

type [-a] <name> — los corchetes marcan lo que puedes omitir.

Q¿Cuántas opciones vale la pena saber?

Aquí van 4; la lista completa está en man type. Este comando está en Procesos y sistema.

Comandos relacionados

página man: man type