Skip to content

Instantly share code, notes, and snippets.

@Dellos7
Last active April 5, 2020 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dellos7/be8b72215672d225b951887faa67bc5c to your computer and use it in GitHub Desktop.
Save Dellos7/be8b72215672d225b951887faa67bc5c to your computer and use it in GitHub Desktop.
Comandos útiles de terminal

Ver procesos activos escuchando en un puerto específico

sudo lsof -i :8080
COMMAND  PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
php     4486 david    7u  IPv6 0xaf27373cf1790fb1      0t0  TCP localhost:http-alt (LISTEN)

OSX

Eliminar un proceso escuchando en un puerto específico (I)

sudo npx kill-port 8080

OSX

Eliminar un proceso escuchando en un puerto específico (II)

sudo kill $(lsof -ti:8080)

Conocer el sistema operativo de la máquina (I)

cat /etc/*-relase
CentOS Linux release 7.7.1908 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.7.1908 (Core)
CentOS Linux release 7.7.1908 (Core)

Linux

Conocer el sistema operativo de la máquina (II)

hostnamectl
   Static hostname: server
   Pretty hostname: Server
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 31e871a0d760404d91649aecb7986bb3
           Boot ID: 7f2d8b8461884f90a3484a3080fb278a
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1062.18.1.el7.x86_64
      Architecture: x86-64

Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment