From 9e1ea4fae416928ec1059f72f452917833905436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20=C3=96zdemircili?= Date: Fri, 30 Aug 2013 12:16:39 +0200 Subject: [PATCH 1/2] New cheats on find --- cheatsheets/find | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cheatsheets/find b/cheatsheets/find index a78583a..a685ec6 100644 --- a/cheatsheets/find +++ b/cheatsheets/find @@ -12,3 +12,7 @@ find . -type f -perm 777 # To find files with setuid bit set: find . -xdev \( -perm -4000 \) -type f -print0 | xargs -0 ls -l + +# To find files bigger thank 2 MB and list them: +find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' + From 6abab41aa6b9836fb8cca1427202a015a7c9d690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20=C3=96zdemircili?= Date: Fri, 30 Aug 2013 12:16:48 +0200 Subject: [PATCH 2/2] New lsof cheat --- cheatsheets/lsof | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cheatsheets/lsof b/cheatsheets/lsof index 2f4ddcc..6b7beef 100644 --- a/cheatsheets/lsof +++ b/cheatsheets/lsof @@ -1,2 +1,5 @@ -# To find listening ports +# To find listening ports: lsof -Pnl +M -i4 + +# To find which program is using the port 80: +lsof -i TCP:80 \ No newline at end of file