Need help in finishing a bash script for listing subfolder by size in a large folder
Greetings everyone.
I have seen that you do wonders here.
I have a large folder on a Ubuntu linux.
Organization main folder, inside 20 000 subfolders, and inside those subolders many other like 5-6 folders and files.
I am interested to create an output to a txt file under the bash shell, for the size only of those 20 000 subfolders, --maxdepth 1.
This is what I have tried so far, I was also trying to ommit with grep folders starting with a letter x, for testing. But whatever I do the command line hangs and produces no output.
this produces nothing but this
gives some output on other server
Any help would be appreciated.
Thanks in advance.
Moderator's Comments:
Please use code tags next time for your code and data
Last edited by Don Cragun; 12-04-2013 at 06:15 AM..
Reason: Add more CODE tags.
The bash executes but returns no results and the set -xv showed while the $run variable in blue, was extracted correctly, the $match value in green, was not, rather both values in home/cmccabe/Desktop/f1 were extracted not just the matching.
There will always be an exact match from the $run to... (7 Replies)
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Hi,
I need to list the names of existing files in a specific folder. I have written a script for that, but the problem is, it is also picking up name of a subfolder that is there in that folder. I need only the list of files and not that subfolder. How to go about that ? Can anyone plz help... (2 Replies)
Hello.
This small part of my script
#!/bin/bash
SRCDIR=/root/.kde4/share/config
for MY_FILE in $(ls $SRCDIR/kate*) ; do
echo "$MY_FILE"
donegive :
So for the moment I have modified my script like this :
#!/bin/bash
SRCDIR=/root/.kde4/share/config
for MY_FILE in $(ls... (5 Replies)
Hi All,
Can anyone refer to me a readymade script for the purpose of log folder size monitoring script.
Example : I have a log folder of size 10 G, and as the logs keep accumulating the folder gets full and i have to manually zip/remove the files in order to keep the server running. Something... (1 Reply)
suppose if i am checking folder g as shown below path
a/b/c/d/e/f/g ,and some directory c,d,e,f,g not present then is there anyway to create directory in one command
or i need to use mkdir for everyfolder (3 Replies)
Hi,
I have the following subfolder with files:
/data/a/1/xxx.txt
/data/b/2/yyy.txt
/data/c/3/zzz.txt
And i have a set of new folders which have exactly the same structure as above but different disk without the files:
/data_02/a/1/
/data_02/b/2/
/data_02/c/3/
Now i would like to... (6 Replies)
Can any one tell how to view folder and subfolder with its capacity
df -k will cannot be used it shows only the parent folder
while du -k will show all subfolder and files but not show the capacity and also i dont want view any files
Thank you!!!! (1 Reply)
Hi friends,
I am getting some trubles in folder reading. I am having 10 subfolders inside server7 folder. i wanna to read a subfolder name first and check if the foldername gets started with "http". if so , i need to read a file inside that folder. This willl continue for... (1 Reply)