Check up/down hosts in your network

To check how many systems are up and how many systems are down in network.use below script

I used nohup to avoid ping output on screen

for i in {1..254} ; do ip=192.168.0.$i && nohup ping -c1 $ip 2> /dev/null && echo "$ip online" || echo "$ip offline" ; done

create tar archive from the list of files

If you want to create tar file from the list (The list may contain files from different folders).

then use below command

tar -zcvf  mytar.tar.gz -T list

This command will read list line by line and keep adding the file mentioned in list to the tar file

How to know your live/Public ip by command line

Run the below command in terminal to know your public ip address

dig -4 @resolver1.opendns.com -t a myip.opendns.com +short