Menu

Useful Commands

This is a list of commands that I find helpful

Linux

Network

lsof -i | List of open files with connection status

netstat -ant | TCP connection status

netstat -anu | UDP connection status

|

alias name 'command' | Create an alias for a command

cat /etc/*release* | OS version

cat /etc/issue | OS version

cat /proc/version | Kernel information

dig domain.com | get DNS information for a domain

dig -x host | reverse lookup host

df -h | Show disk usage (human readable)

du -h | Show directory space usage (human readable)

ln -s file link | Create symbolic link to file

lsof -i | List open files with connection status

netstat -ant | Top tcp network connection status

netstat -anu | Top udp network connection status

ps -aef | Display your current active processes

scp -r user@host:dir dir | secure copy the directory dir from remote server to the directory dir on your machine

scp file user@host:dir | secure copy a file from your machine to the dir directory on a remote server

scp user@host:file dir | secure copy a file from remote server to the dir directory on your machine

uname -a | CPU arch and kernel version

Windows

arp -a | Show ARP table with MACs

cmdkey /list | List cached credentials

ipconfig /all | Show IP configuration

ipconfig /displaydns | Show DNS cache

net accounts /domain | Show domain password policy

net group "Domain Admins" /domain | Show Domain Admin users

net group "Domain Controllers" /domain | List Domain Controllers

net group /domain | Show domain groups

net localgroup "Administrators" | Show local Admins

net localgroup "Administrators" user /add | Add a user to the Admin local group

net share | Show current mounted shares

net user /domain | Show users in local domain

netstat –nao | Show all TCP/UDP active ports and PIDs

nslookup <IP> | Perform reverse DNS lookup

route print | Show routing table