Here are some interesting Operating system and softwares tips and tricks 4u.JUST CLICK ON THE PICTURE IN THE BLOG FOR ENALARGED VIEW.

sd

Thursday, February 23, 2012

Trace the biggest files(Windows Vista, 7)

By Thursday, February 23, 2012 , No comments
              You are searching for the biggest space hog in a particular folder structure, but wish there was a tool or method with which you can identify the biggest fi les on a drive.
              This job is easily possible with Vista/7 with Windows tools. Use Windows PowerShell for that, which you can run using the search field of the Start menu. Thus you can automate the respective query by sorting and filtration.
               Principally, we want to first generate a list of all the files in a folder including the sub-folders. Then sort this list as per the size of the file and fi nally allow only the first elements of it to be displayed. In PowerShell you can connect all the necessary commands and create a single line to type in.
              You can generate the list of all the files of the respective folder including the sub-folder with the command ‘Get-ChildItem [folder]-recurse’. The parameter ‘-recurse’ includes all sub-folders in the search. Instead of ‘Get-ChildItem’ you can also use the usual alias ‘dir’ (directory). In the next step sort the contents in descending sequence as per the size of the file via ‘Sort-Object length –descending’. You must connect both the commands with the pipe symbol ‘|’ in a line, so that the result of the first command is at disposal of the second command. Similarly filter the first twenty events with ‘Select- Object-first 20’, thus showing you the 20 biggest files. Finally add the command ‘WriteOutput’ for display. The complete command is as follows:
              Get-childitem [folder] –recurse | sortobject length –descending | select-object –first 20 | write-output
NOTE: You can copy the complete command from a text fi le in the clipboard, instead of entering it newly. Then change to PowerShell. Paste the content by a right click with the mouse instead of the usual button combination [Ctrl]+[V].

0 comments:

Post a Comment

please write your comment

Note: Only a member of this blog may post a comment.

THE WINDOWS TRICKS Headline Animator