Categories
Linux

Trace Route for an IP

Traceroute command

traceroute 8.8.8.8

IP Route command

ip route get 8.8.8.8

Other commands

ip route list
Categories
Command Line

Log terminal commands and output

Script Method

Start

script screen.log

End

exit

Alternate method

[COMMAND] > output.txt

Appending to previous data

[COMMAND] >> output.txt
Categories
Command Line

Diff terminal command basic

Usage

diff file1.doc file2.doc

List of lines added

diff --changed-group-format='%>' --unchanged-group-format='' file1.doc file2.doc
diff -u file1.rsc file2.rsc | grep -E "^\+"

List of lines removed

diff --changed-group-format='%<' --unchanged-group-format='' file1.doc file2.doc
diff -u file1.rsc file2.rsc | grep -E "^\-"
Categories
Web Server

Nmap basic commands to check ports

nmap [HOSTNAME]
nmap localhost
nmap xx.xx.xx.xx
nmap -p 1-65535 localhost
nmap -p 80,443 8.8.8.8

Multiple IP Addresses

nmap 1.1.1.1 8.8.8.8
nmap -p 1.1.1.1,2,3,4
nmap -p 8.8.8.0/28
nmap 8.8.8.1-14
nmap  8.8.8.*
nmap -p 8.8.8.* --exclude  8.8.8.5

Top ports

nmap --top-ports 10 192.168.1.1

Scan from a text file

nmap -iL list.txt

Save to file

nmap -oN output.txt localhost
nmap -oX output.xml localhost

OS and service detection

nmap -A -T4 localhost

Service and Daemon version

nmap -sV localhost
Categories
Linux

Get Recently installed softwares in Debian

Via command line

cat /var/log/dpkg.log.1 | grep "install"