web analytics

Posts Tagged ‘server’

Setting Up A Ubuntu Web-Server On A Remote Host – Ubuntu Lamp

Written by config on . Posted in Linux, Ubuntu

Advertisement

The main advantage of using and setting up a Linux server is that it will be interesting and informative as you learn lot of things on how to customize and fine tune the Open Source operating system to your needs,‭ ‬and of course this is fun and you will feel happy when you yourself do things on your own,‭ ‬isn’t it‭?
In this Tutorial you will learn how to install LAMP on Ubuntu server. Including all the components – fast and easy straight from the repo.

Finding large files on Linux distributions

Written by config on . Posted in Linux

Finding large files on all operating systems is a daily task for systems administrators around the world, it serves a lot of purposes.
I will show multiple ways to do it on various Linux distribution. Simple and makes your life easier.

Pay attention to the size in all examples – change it according to your needs.

RPM Based distributions: Red Hat, Centos, Fedora

Specify path:

find {/path/to/location/} -type f -size +{size-in-kb}k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Example for specific path:

find /home/http/logs -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Current Dir:

find . -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Debian or Debian based ( Ubuntu and various other deb based distros )

Specify path:

find {/path/to/location} -type f -size +{file-size-in-kb}k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'

Current Dir:

find . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'

Largest files in directory:

ls -lSh | less

du -xakh .|sort -n|tail -10

du -k | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf                 ("%6.1f\t%s\t%25s  %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),"*"x (1.5*$l),$2);}'

find . -type f -print0 | xargs -0 ls -lSh | head -10