TRiBByX
9/20/2018 - 8:56 AM

Bash

Some useful commands and bash scripts i use.

netstat -lntp
find -name '*' | xargs rm
tree -a
mv folder/*          #  This only moves subfolder, not content futher down
l -la
virtualenv -p python *name*
ps -aux | less 
curl ipinfo.io/ip    # Get external IP
cat *file* | less      # Pipe long files into 'less' to browse through easier
sudo dpkg -i *filename*  # For .deb files in ubuntu.
iperf -s and iperf -c *ip* to test connection between 2 machines.
sed -i 's/\<*this*\>*replaced by this*/' *path to file*
#!/bin/bash
# Somehow my eth0 doesn't work on my VM Ware Workstation Kali machine, this fixes it.
# To make this run at startup:
#   1. cd ~
#   2. echo 'sudo dhclient eth0' > fix.sh
#   3. chmod +x fix.sh
#   4. .bashrc >> sudo ./fix.sh

sudo dhclient eth0