Snippets/ Terminal/ Shell

Sun, 9 Feb. 2020     Thomas Bendler     ~ 1 min to read

In this chapter, I will share with you some snippets/ one-liners I used with several command-line tools more or less frequently during my administrator career. Maybe you find some of them useful and I hope, in the end, they will ease your work.


What is my public IPv4 address:

> curl -4

What is my public IPv6 address:

> curl -6

In which country is my public IP address registered:

> curl

In which city is my public IP address registered:

> curl


Recursively move all files except partially downloaded files to a different storage location:

> find . -type f -print0 | \
    while read -d $'\0' file; do if [[ ! ("$file" =~ "\.part$") ]]; then \
    mv "$file" /media/storage/videos; fi; done


Share on: