Programming :: Getting The Disk Usage For Certain Files Per Directory?
Mar 26, 2010
I am trying to get the total file size for certain files per directory.I am usingfind `pwd` /DirectoryPath -name '*.dta' -exec ls -l {} ; | awk '{ print $NF ": " $5 }' > /users/cergun/My Documents/dtafiles.txtbut this lists all the files in the directoriesI need the total per directory for all dta files.
View 1 Replies
ADVERTISEMENT
Mar 25, 2010
I am trying to get the total file size for certain files per directory.
I am using
find `pwd` /DirectoryPath -name '*.dta' -exec ls -l {} ; | awk '{ print $NF ": " $5 }' > /users/cergun/My Documents/dtafiles.txt
but this lists all the files in the directories.
I need the total per directory for all dta files.
View 2 Replies
View Related
Aug 22, 2010
I have root on sda1 and home on sdb1.
I am getting close to full and wanted to analyze what apps or files are taking up the most room.
How do I navigate to sda1 in Disk Usage Analyzer?
"/" says 100% 121.5GB in dua (see attached screenshot)
Code:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 3.7G 3.2G 317M 92% /
none 493M 340K 493M 1% /dev
[Code]....
View 9 Replies
View Related
Jun 13, 2011
Can anyone explain this output? I'm not sure what to make of it. 36% usage and no files??
root@host:/backups# ls -la
total 8
drwxr-xr-x 2 root root 4096 Mar 8 20:12 .
[code]....
View 3 Replies
View Related
Aug 18, 2010
How do I get Ubuntu's "Disk Usage Analyzer" to show me the hidden files?
It tells me my home dir uses 3GB, but only accounts for 525MB (the results of du -shc *). Can I get it to show me the other files that are using the space?
View 4 Replies
View Related
Oct 23, 2010
I am running an Opensuse 11.2 system as a backup file server. Several external hard drives are attached via USB and mounted during boot via the fstab file. Recently, I noticed the df command showed the root partition being >65% full, while the du command showed the same drive was only about 20% full. After much investigation, I discovered that some large directories had been created under the /media folder on the root partition that were hidden when the external drives were mounted as directories with the same names under /media. I could only see this when I rebooted with a live CD and mounted the suspect partition without the external drives mounted. Is there a way to examine whether a mounted partition has existing files "hidden" when a separate file system is mounted "on top of it"?
View 9 Replies
View Related
Nov 14, 2010
There are millions of files in many directories. Wherenver i try rm * or find or use xargs, they say 'argument list too long' and exit. How can i deleted files in a directory with so many files without deleting the directory itself.
View 3 Replies
View Related
Mar 15, 2010
I was trying to get the status of memory usage and disk usage using sigar in windows and ubuntu. done this in windows by just copying the sigar library into jdk library. But i was unable to do so in ubuntu. I've copied the library to java-6-sun library but still can't run the program.
View 14 Replies
View Related
Dec 10, 2010
I'm running into a problem where my system is running out of disk space on the root partition, but I can't figure out where the runaway usage is. I've had a stable system for a couple of years now, and it just ran out of space. I cleaned some files up to get the system workable again, but can't find the big usage area, and I'm getting conflicting results.For example, when I do a df it says I'm using 44GB out of 58 GB:
Code:
[root@Zion ~]# df -h
Filesystem Size Used Avail Use% Mounted on
[code]....
View 5 Replies
View Related
Jan 3, 2009
After i try to find logfiles follow date/month/year. i want copy this files to another directory with name's directory is time you find(date/month/year).
View 4 Replies
View Related
Feb 26, 2011
Some thing is using up a huge amount of my disk space about 10G and I can not determine what it is. When I look at my disk usage in system monitor it say I have used about 25G and when I scan the directory in disk usage analyzer the entire file system used is 15G.
View 1 Replies
View Related
Apr 8, 2010
I was preparing a script which will remove all my files from directory which are 24 hour old.I tried some thing like thisfind . ( -name 'log.*' -mtime +1 ) -exec rm {}; but it is throughing error like : missing argument to exec.
View 8 Replies
View Related
Aug 4, 2010
Kernel 2.6.21.5, GNU (Slackware 12.0).
Bash 3.1.17.
I want to search an entire subtree of /, in the file system, for all files, with extension html, created on the hard disk. In addition, these have to be the last five created. I think I could split the problem into two parts: (a) Forget about the last condition. Then this is a job for the find command. (b) Sort the output of find using the date as the key, then use 'head' to print the desired output. But even two such simple steps are enough to justify the writing of a shell script. And here lies my weakness.
My script writing knowledge is rudimentary. What's the final purpose? Well, I lately saved four or five LQ pages onto disk containing information I consider valuable to me. But I don't exactly remember where on the disk. Then: either the problem posed is really of a very simple nature or it is not, in the latter case a script being mandatory. One of the algorithm drawbacks (the one described above) is that find may be running a great deal of time. My machine resources (RAM and CPU speed are low) are scarce and there possible are a large number of HTML files on the disk.
View 8 Replies
View Related
Jan 3, 2011
find . -type f -name "*" -print0 | xargs -0 --replace=% mv % `pwd`
works fine at moving all files anywhere below the current directory to the current directory.
My question is can it be modified so it only moves all the files up one directory layer? Otherwise I shall have to cd 100 or so times and run it in each directory i want to compress...
I imagine the directory below which the file is stored is in the % somewhere it is just a case of extracting it and applying it to the mv command, yes?
View 8 Replies
View Related
Apr 7, 2011
Word Count for all files in a directory
View 1 Replies
View Related
Jul 7, 2010
I wanted formated output of all the files under a particular directory. I am trying to use find.Something like find -P ./ -type f -name '*.cpp' -printf "%p "I want all the files with specific extension like .c .cpp .h to be printed out separated by space. One more thing i want is absolute path names instead of relative.
View 5 Replies
View Related
Nov 19, 2008
How can I write a script that will go through the files in a directory and print on the screen the name of the files stating if it is a file or directory. The directory is already provided by the user.
View 12 Replies
View Related
Feb 14, 2011
When I run:make -f mymakefile clean I get:rm -f mybinary *.so.* *.dep *.o mybinary.symand all the above files are removed from the current directory.But I have a directory /src/ where I have all my source files located. The *.o file in this directory are not removed?
View 4 Replies
View Related
Nov 6, 2010
I am trying to write a simple script to list all the files in a directory. The script I wrote was as below where the pdb_files is a directory and all the files which I want to list are in that folder.
Code:
files=`ls -F pdb_files/*THERMO*`
for inFiles in $files
do
echo $inFiles
[Code]....
View 5 Replies
View Related
Jun 23, 2010
I once had a script that when run would find the first 800GB of files in a directory (including subdirectories) and write them to a file (ie: ./800gb.sh > manifest.txt).I used this to create manifests of 800GB worth of data from large directories in order to dump to tape (LTO4).I'm sure its gotta be a pretty simple script, but I am not very skilled at writing bash scripts.
View 4 Replies
View Related
Aug 20, 2010
I got a directory with files in it like: 2006-07-01.foo2007-08-04.foo I need to update the timestamps on these files using "touch -t 200607010000 2006-07-01.foo" on each file in the directory so I came up with the following one liner:
for i in `ls -1`; do touch -t `ls -1 | sed -n 's%([0-9]{4})-([0-9]{2})-([0-9]{2})(.*)%1230000%p'` $i; done
My goal was to use sed and get the timestamp for touch and then loop through each file and touch with the timestamp.However the script, not giving me the results I intended. Can anyone chime in on what I am doing wrong?I have been banging away at this for a couple of hours now and am clueless on what it could be. I also tried another variant such as:
for z in $(ls -1 *.foo); do echo $z $(for i in `ls -1 *.foo | sed 's%([0-9]{4})-([0-9]{2})-([0-9]{2})(.*)%1230000%p'`; do echo "$i"; done); done
View 5 Replies
View Related
Jul 22, 2011
I have about 50 files that the script will operate on, they are all located in the same directory.I need a bash script that will operate on all files in a directory. The script needs to add two lines to the beginning of each file based on the file name, and one line to the end of the file.A file named myfile.h should add these two lines to beginning of the file:
Code:
#ifndef MYFILE_H
#define MYFILE_H
[code]....
View 5 Replies
View Related
Jan 31, 2009
i was wondering if there's a bash script to check the amount of files in a directory with an IF statement..
View 8 Replies
View Related
Feb 15, 2010
How to list only hidden files in current directory ?
View 2 Replies
View Related
Aug 19, 2010
I have a bunch of files that contain a date, then data. When I use join, I get exactly the output I need. But manually joining the first with the second, then that output with the third and so on would take days. I have thousands of files. Can any of you folks help me write a script that would do this?To put it another way, for clarity's sake, here is what I am currently doing
If I were to repeat that 3000 times the final output would be what I need. I know a simple script would do this for me, but I can't figure out how to write it.
View 12 Replies
View Related
Oct 1, 2010
Code:
<html>
<head>
</head>
<body>
[Code]....
Alright this works fine to pull the directories/files in the /var/Store/2010/ directory.
But when you click on of the links it tries to http://'serveradress'/$filename
note that $filename in the url is the filename clicked on so the php script is working. but I need it to change to that dir so that you can see the folder/files there and work your way up/down/side wise thru the folder tree to where you need to go. Not try and pop it as a direct url which doesn't work.
View 3 Replies
View Related
Nov 25, 2010
I have managed to get it to install the files in the BUILDROOT directory correctly but when I add the directories under the file it seems to try and install the files from root. my rpmmacros is as follows:
Code:
%_topdir /home/rpmbuild
# The directory where buildroots will be created.
%_buildrootdir %{_topdir}/BUILDROOT
[code]...
View 1 Replies
View Related
May 16, 2011
I have to create a script to identify those users who have un-sanctioned (forbidden) files in their home directory. I tried something like this (this is a try and I need some opinions):
Code: #!/bin/bash
user_belongs() {
if `groups $var1 | grep $var2`
then
return 0 else
return 1
fi
} .....
View 1 Replies
View Related
Dec 29, 2010
Originally Posted by Kenny_StrawnPlease wrap [CODE] tags aroung any code posted here. The full source that way could still be posted.I am trying to copy all the files in the directory based on the modification date (i.e created on Dec 29). Not able to find the proper command for this. This is what I have tried.
(none) login: root
#
# cd /mnt/hd/
[code]...
View 8 Replies
View Related
Apr 1, 2011
I want to write a script that will detect all the unwanted files in a particular directory and delete them in one fly..
View 11 Replies
View Related