Tag Info

New answers tagged

0

Your first bet if you want to keep/fix most of the content: Connect it to a real windows box, and run chkdsk /f /r upon that drive Warning: This may take several hours. Check e.g. http://technet.microsoft.com/en-us/magazine/ee872425.aspx for the usage. As the used filesystem was not specified, I'm also assuming NTFS due to the obvious autorun.inf file and ...


1

Why not just delete the annals directory? # rm -r /run/media/Harry/CA6C321E6C32062B/annals Note: It looks like it's been in a Windows machine as it has a System Volume Information directory. This means it's probably NTFS? If that's the case, then you'd be better off formatting it with a more *nix friendly filesystem. Of course, that assumes you don't ...


2

If you are looking for directories that are using up space, and are not on a different partition, then you want du -hx --max-depth=1 /. The -x tells it not to descend into directories that are on other filesystems ( partitions ). The --max-depth=1 asks to only print a line ( listing the total space for that directory and all subdirectories ) for each ...


1

If I am reading this question correctly, there is a program called tree. This would list all directories in a tree like structure. With it installed, you can do something like: tree -x Where -x Stay on the current file-system only. Ala find -xdev. UPDATE: I have tried tree -P /dev/xvda and it seemed to have shown directories under that filesystem. The -P ...


0

But, how will I know the list of directories under /sda2? There are no directories under /dev/sda2, /dev/sda2 is a partition on the disk (sda is the disk and 2 is the partitions number). But, is there any command or way through which I can also list down their filesystem too? Since you only have one filesystem mounted then they are all on the / ...


0

Run du -x / >/tmp/du to generate a breakdown of disk usage per directory on the / filesystem (-x means “don't traverse other filesystems”). Your biggest consumers are: 588M /home — 0.6GB of user data 1015M /opt — 1GB of software that you installed manually 6.4G /usr — 6.4GB of software installed via packages 350M /var — 0.3GB of data used by ...


0

With GNU du (i.e. on non-embedded Linux or Cygwin), you can use the --exclude option to exclude the files you don't want to match. du -s --exclude='*.html' /var/foo If you want to positively match *.pdf files, you'll need to use some other method to list the files, and du will at least display one output line per argument, plus a grand total with the ...


1

You can let the shell expand the files: $ mkdir foo $ echo "abc" > foo/1.pdf $ echo "abcd" > foo/2.pdf $ echo "abcd" > foo/3.html $ du -ch foo/*.pdf 4,0K foo/1.pdf 4,0K foo/2.pdf 8,0K total However as you can see this indiates filesizes about 1000 times as just created. A better option is using the -b option: $ du -cbh foo/*.pdf 4 ...


3

Take note, that this is fragile when it comes to nasty file names. dir_with_small_files=/home/john/files tmpdir=/tmp/ul/dst tarfile=/tmp/ul.tar mkfifo "${tarfile}" gzip <"${tarfile}" >"${tarfile}.gz" & find "$dir_with_small_files" -type f | \ while read src; do dstdir="${tmpdir}/$(dirname $src)" dst="$(basename $src .gz)" mkdir -p ...


6

An option could be to use avfs (here assuming a GNU system): mkdir ~/AVFS && avfsd ~/AVFS && cd ~/AVFS/where/your/gz/files/are/ && find . -name '*.gz' -type f -printf '%p#\0' | tar --null -T - --transform='s/.gz#$//' -cf - | pigz > /dest/file.tar.gz


2

Here's what I tried so far - it seems to work, but is terribly slow, even with PyPy: #!/usr/bin/python import tarfile import os import gzip import sys import cStringIO tar = tarfile.open("/dev/stdout", "w|") for name in sys.stdin: name = name[:-1] # remove the trailing newline try: f = gzip.open(name) b = f.read() ...


1

# do this part one time only mkdir /path/to/mytmp chmod 1777 /path/to/mytmp # put this in .bashrc or your login .profile file # it has to execute BEFORE you want TMPDIR to work export TMPDIR=/path/to/mytmp FWIW- 800 MB free on the root "/" directory does not sound like a long term good idea. If the / directory becomes full your system will freeze and/or ...


1

Try out ncdu. This is an ncurses-based mc-like directory browser that will let you see which directories are most occupied and optionally delete the ones you're not interested in, as seen on this screenshot:


0

There are also nice graphical tools to help figure out what in is taking up lots of space in a directory. I like Filelight which is part of KDE. Here it is exploring /var/cache on my computer. The green and the yellow are related to apt, the red is java, and the magenta is pbuilder. The inner circles the immediate subdirectories and they are broken ...


1

You don't say what filesystem type is used for /scratch; I expect it's ext4. ext4 uses 4k blocks for allocation, so that's the smallest amount of space that a filesystem object can use (excluding zero-sized files, of course). ZFS is quite a special filesystem and apparently uses 512-byte blocks for allocating space. Perhaps after you had accessed the ...


2

Not necessarily the answer you're looking for, but something good to know about is: sudo du -max /var/lib/jenkins | sort -n That's probably one of the commands I use most often for this sort of thing. The "-a" includes total directory size (so you'll see a directory full of small files as one big directory in the final output, as well as seeing all the ...


6

With this command, sudo du -csh * you are missing hidden directories, i.e. * expands to all names starting with anything but a dot (.). That means all directory names starting with a dot are not passed to the du command and their size is not taken into account. In most situations, adding .??* to the parameters would fit the needs : sudo du -csh .??* * ...


2

If you use either find ... -exec COMMAND {} + or find ... -print0 | xargs -0 COMMAND, xargs or find will be build a list of filename arguments no longer than each command’s defined buffer space (bounded by ARG_MAX). If the buffer space is exhausted, each command will pass the list of filename arguments to COMMAND and start creating a new list. That process ...


0

In addition to already suggested causes, it could be also following: a different disk is mounted "over" the existing folder which is full of data du will calculate the size spent of mounted disk and df will show really spent solution: (when possible) unmount all non-root disks and check the size with du -md 1 again. Fix situation by moving hidden folder to ...


1

du doesn't seem to accept files piped into it. I think what you're looking for is find /u02/archivelog -type f -mmin -1440 -exec du -ch {} + Using the + instead of the ; makes find build up {} as a list and executes once, instead of executing once for each match. You also need to use -type f, otherwise it'll match the directory itself, which is modified ...


1

Your use of {} \; limits the argument of ls to one element. If you are interested in the total of the archive logs you could use: find /u02/archivelog -mmin -1440 -type f -exec wc -c {} + | tail -1 To get the total number of bytes for the files under that directory. Where the {} + puts as many filenames on the commandline presented to wc as the system ...



Top 50 recent answers are included