Looking for Large Files and Folders


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Looking for Large Files and Folders
# 1  
Old 03-31-2008
Looking for Large Files and Folders

Hello,

On one of my UNIX boxes, there are many folders. I'm looking for a way / command that will search for and display folder names / location / size so I can do some cleanups.

How can I do this?
# 2  
Old 03-31-2008
Try running "du -a |sort -r -n >sorted.list" from / as root

It will give you a list of all files and directories sorted in descending order by size.
# 3  
Old 03-31-2008
Thanks. That worked. But is the size in MB or what? How can I get it in GB?
# 4  
Old 03-31-2008
Try the -B option of du command

Code:
du -BG -a | sort -r -n

Jean-Pierre.
# 5  
Old 03-31-2008
Quote:
Originally Posted by bbbngowc
Thanks. That worked. But is the size in MB or what? How can I get it in GB?
If you read the man page (man du), you will find the simple option for that. It would have been a lot less work for me to just tell you, but you should have checked it yourself, and this isn't the forum to ask everyone to do your thinking for you.

I apologize if you somehow didn't know about the "man" command, or honestly forgot to actually try looking for the answer yourself instead of asking to be spoon-fed. But considering how little work it would have taken, I'm assuming you're just lazy.

ShawnMilo
# 6  
Old 03-31-2008
Not Lazy, just new to UNIX. I am aware of the "man" command, just simply forgot about it. Thanks tho.
# 7  
Old 03-31-2008
Quote:
Originally Posted by bbbngowc
Not Lazy, just new to UNIX. I am aware of the "man" command, just simply forgot about it. Thanks tho.
Well then, welcome to the wonderful world of *nix! You'll find that some man pages are helpful, and some not so much, and there's not much you can do about it.

But when it comes to getting info out of your fellow geek, you can greatly increase your expected bounty by asking a question in a way which shows you've put thought, work, or both into solving your own problem.

Also, I don't know if it will help you much in the near-term, but try out the "apropos" command as well. It might lead you to some commands you will find useful. Having said that, I usually go straight to Google if I can't figure something out in about five minutes on the command line. Even if that doesn't result in the answer, I can at least say "I tried x and it didn't work. What's the right way?"

Shawn
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to compare files in 2 folders and delete the large file

Hello, my first thread here. I've been searching and fiddling around for about a week and I cannot find a solution.:confused: I have been converting all of my home videos to HEVC and sometimes the files end up smaller and sometimes they don't. I am currently comparing all the video files... (5 Replies)
Discussion started by: Josh52180
5 Replies

2. Shell Programming and Scripting

How to copy files/folders and show the files/folders?

Hi, So i know we use cp -r as a basic to copy folders/files. I would like this BUT i would like to show the output of the files being copied. With the amazing knowledge i have i have gone as far as this: 1) find source/* -exec cp -r {} target/ \; 2) for ObjectToBeCopied in `find... (6 Replies)
Discussion started by: Imre
6 Replies

3. Shell Programming and Scripting

List all the files in the present path and Folders and subfolders files also

Hi, I need a script/command to list out all the files in current path and also the files in folder and subfolders. Ex: My files are like below $ ls -lrt total 8 -rw-r--r-- 1 abc users 419 May 25 10:27 abcd.xml drwxr-xr-x 3 abc users 4096 May 25 10:28 TEST $ Under TEST, there are... (2 Replies)
Discussion started by: divya bandipotu
2 Replies

4. UNIX for Dummies Questions & Answers

Searching for folders/parent folders not files.

Hello again, A little while back I got help with creating a command to search all directories and sub directories for files from daystart of day x. I'm wondering if there is a command that I've overlooked that may be able to search for / write folder names to an output file which ideally... (2 Replies)
Discussion started by: Aussiemick
2 Replies

5. Solaris

How to safely copy full filesystems with large files (10Gb files)

Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS. I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies

6. Shell Programming and Scripting

Divide large data files into smaller files

Hello everyone! I have 2 types of files in the following format: 1) *.fa >1234 ...some text... >2345 ...some text... >3456 ...some text... . . . . 2) *.info >1234 (7 Replies)
Discussion started by: ad23
7 Replies

7. Shell Programming and Scripting

Compare 2 folders to find several missing files among huge amounts of files.

Hi, all: I've got two folders, say, "folder1" and "folder2". Under each, there are thousands of files. It's quite obvious that there are some files missing in each. I just would like to find them. I believe this can be done by "diff" command. However, if I change the above question a... (1 Reply)
Discussion started by: jiapei100
1 Replies

8. HP-UX

to get the timestamp of files from the files and folders in Unix

Hi, I had a directory and many subdirectories and files with in it. Now i want to get the timestamp of files from the files and folders recursively. :( Please help me to generate a script fort he above mentioned requirement! Appreciate for ur qick response Thanks in advance! ... (2 Replies)
Discussion started by: kishan
2 Replies

9. Shell Programming and Scripting

removing old files except configuration files and folders

Dear all, I want to remove files older than 2 months in the /home/member directory. But except the configuration files (like .bash_profile .config/ .openoffice/ .local/ .kde/ etc..) I have tried with the command find . -mtime +60 -wholename './.*' -prune -o -print -exec mv {} \; but it... (1 Reply)
Discussion started by: jamcalicut
1 Replies

10. UNIX for Dummies Questions & Answers

How to Differentiate Between Files and Folders?

Hi All, I'm a rookie using HPUX and I know this is going to sound like a bonehead question, but when I list the contents of a directory, how can I determine which objects are files and which are folders? I'm using the ll and ls commands to lists the contents. So far I've been determining the... (6 Replies)
Discussion started by: dgower2
6 Replies
Login or Register to Ask a Question