cvwiki

Unix Commands

Nov 5, 2022

# Cheat Sheets

# Users / Groups

To get the current user in a shell or script, run the below command

1
whoami

or

1
echo "$USER"

# SSH

1
ssh -q $SSH_USER@$SERVER "nohup /appl/bin/start.sh start > /dev/null 2>&1 & "

# Verify DNS Resolution

1
nslookup www.google.com

# IP Address

# Public IP Address of local machine

1
curl ifconfig.me

# Private IP Address of local machine

1
ifconfig -a

# Grand total size of all the subdirectories in the current directory

# Process ID Number

lsof -p PID will list all the files that have been touched by the currently running process

# egrep

# find command

# scp file transfer commands

# list/installation/deletion of certs with keytool

# OpenSSL commands

# What’s using this port?

1
sudo lsof -i :3306