diff --git a/cheatsheets/find b/cheatsheets/find index a506327..a8ef46b 100644 --- a/cheatsheets/find +++ b/cheatsheets/find @@ -22,3 +22,5 @@ find ./path/ -name '*.txt' | xargs grep 'string' # To find files with size bigger than 5 Mb and sort them by size: find ./ -size +5M -type f -print0 | xargs -0 ls -Ssh +# To find files bigger thank 2 MB and list them: +find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' diff --git a/cheatsheets/lsof b/cheatsheets/lsof index 2f4ddcc..ca08a02 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