PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Finding the biggest files on linux and creating a function for biggest

Go down

Finding the biggest files on linux and creating a function for biggest Empty Finding the biggest files on linux and creating a function for biggest

Post by jamied_uk 11th November 2022, 09:55

Finding the biggest files on linux and creating a function for biggest



Code:
du -ah | sort -hr | head -n 10


Edit .bashrc file

Code:
sudo gedit ~/.bashrc

add this to end of file with the other functions!



Code:
function biggest(){
du -ah | sort -hr | head -n 10
echo "Complete!"
}



Save and now type


Code:
biggest
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Finding the biggest files on linux and creating a function for biggest Empty Re: Finding the biggest files on linux and creating a function for biggest

Post by jamied_uk 11th November 2022, 09:59

Other helpful cmds

To find the 10 biggest folders in current directory:
Code:
du -h | sort -hr | head -n 10
To find the 10 biggest files and folders in current directory:
Code:
du -ah | sort -hr | head -n 10
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Finding the biggest files on linux and creating a function for biggest Empty Re: Finding the biggest files on linux and creating a function for biggest

Post by jamied_uk 11th November 2022, 10:00

More advanced

linuxhandbook.com/find-biggest-files-linux
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Finding the biggest files on linux and creating a function for biggest Empty Re: Finding the biggest files on linux and creating a function for biggest

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum