Useful UNIX commands

Here are a few very useful UNIX commands that save my life from time to time 😉

Order files by size

> ls -lS

Will list the content of the current folder, ordering files by size from largest to smallest.

Find files larger than 1Gb

find ./ -size +1G -exec ls -l {} \;

This is particularly useful to find a log file that is not rotated. Some environments are broken when a file reaches 2Gb…

Block a remote IP address

iptables -A INPUT -p all -s $IP_ADDRESS -j DROP

Be careful not to block your own IP address, the only way to get out of this one would be to access the server from another IP address or get physical access to it.

2 thoughts on “Useful UNIX commands

  1. Carlota1979

    Hi blogger, do you monetize your ? There is easy method
    to earn extra money every day, just search on youtube
    : How to earn with wordai 4

  2. 83Krystyna

    Hi blogger, i must say you have very interesting articles here.
    Your page should go viral. You need initial traffic boost only.
    How to get it? Search for; Mertiso’s tips go viral

Leave a Reply

Your email address will not be published. Required fields are marked *