Linux Cheatsheet

Linux Cheatsheet

Linux Cheatsheet is here just to not waste time when i will try to remember one of these commands.

1. Find all files changed in a certain range of time

To find all files modified on the 26 June, 2015:

-newermt – modified files
-newerat – accessed files
-newerct – files which had their permission changed

2. Find files containing text

3. Get a number of files in a directory

4. Delete large number of files

rm does not help in this cause. Usually you will get smth like “/bin/rm: Argument list too long.”

5. Change owner/group of files recursively

6. Change permission of files recursively

7. Get folder size

-h is to get the numbers “human readable”, e.g. get 140M instead of 143260 (size in KBytes)
-s is for summary (otherwise you’ll get not only the size of the folder but also for everything in the folder separately)

8. Find files bigger than 100MB

If you want the current dir only:

9. Working with iptables

add rule to block certain IP

insert rule to block IP into first line

save current iptables rules to file

search for blocked IP address

list INPUT rules with line numbers

delete rule on line 3

To be updated…

Leave a Reply

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