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.
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)
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,
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)
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 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)
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,
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)
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)
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)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT HPUX
flist
FLIST(1) [nmh-1.5] FLIST(1)NAME
flist, flists - list the number of messages in given sequence(s)
SYNOPSIS
flist [+folder1 [+folder2 ...]] [-sequence name1 [-sequence name2 ...]] [-all | -noall] [-showzero | -noshowzero] [-recurse | -norecurse]
[-fast | -nofast] [-alpha | -noalpha] [-version] [-help]
flists is equivalent to flist -all
DESCRIPTION
Flist is used to search a list of folders and display the number of messages in these folders that are in a given sequence or set of
sequences (for example the "unseen" sequence). This is especially useful if you use some mechanism such as slocal or procmail (typically in
conjunction with rcvstore) to pre-sort your mail into different folders before you view it.
By default, the command flist will search the current folder for the given sequence or sequences (usually "unseen"). If (possibly multi-
ple) folders are specified on the command line with +folder, then all these folders are searched for the given sequence(s). Flist will
display for each folder searched, the number of messages in each of the specified sequences, and the total number of messages.
The option -sequence is used to specify the name of a sequence in which to search for. This option may be used multiple times to specify
multiple sequences. If this is not given, then the default is to search for all the sequences specified by the "Unseen-Sequence" profile
component. For more details about sequences, read the mh-sequence(5) man page.
Typically, flist will produce a line for each sequence, for every folder that is searched, even those which do not contain any messages in
the given sequence. Specifying -noshowzero will cause flist to print only those folder/sequence combinations such the folder has a non-
zero number of messages in the given specified sequence.
If -recurse is given, then for each folder that is search, flist will also recursively descend into those folders to search subfolders for
the given sequence.
If -fast is given, only the names of the folders searched will be displayed, and flist will suppress all other output. If this option is
used in conjunction with -noshowzero, then flist will only print the names of those folders searched that contain messages in in at least
one of the specified sequences.
Multiple Folders
If the option -all is given (and no folders are specified with +folder), then flist will search all the folders in the top level of the
users nmh directory. These folders are all preceded by the read-only folders, which occur as "atr-cur-" entries in the user's nmh context.
An example of the output of flist -all is:
/work/Mail has 5 in sequence unseen (private); out of 46
inbox+ has 10 in sequence unseen ; out of 153
junklist has 0 in sequence unseen ; out of 63
postmaster has 1 in sequence unseen ; out of 3
The "+" after inbox indicates that it is the current folder.
The "private" flag indicates that the given sequence for that folder is private. See the mh-sequence(5) man page for details about private
sequences.
If the option -all and +folder are both specified, then flist will search this folder, and all its first level subfolders for the given
sequence. You may specify multiple folders in this way.
If flist is invoked by a name ending with "s" (e.g. flists), then the switch -all is assumed by default.
The sorting order for the listing is alphabetical (with -alpha), or in a priority order defined by the "Flist-Order" profile entry (with
-noalpha). Each item in the "Flist-Order" is a folder name or a folder name pattern that uses * to match zero or more characters. Longer
matching patterns have precedence over shorter matching patterns. For example:
Flist-Order: personal petproject mh* * admin *junk
This order puts a few interesting folders first, such as those with mail addressed to you personally, those about a pet project, and those
about mh-related things. It places uninteresting folders at the end, and it puts everything else in the middle in alphabetical order.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
mh-sequences: File that contains public sequences
Unseen-Sequence: The name of the unseen message sequence
Flist-Order: To sort folders by priority
SEE ALSO folder(1), rcvstore(1), slocal(1), mh-sequence(5)DEFAULTS
`-sequence' defaults to Unseen-Sequence profile entry
`-showzero'
`-noall'
`-norecurse'
`-noalpha'
`-nofast'
CONTEXT
If +folder is given, it will become the current folder. If multiple folders are given, the last one specified will become the current
folder.
MH.6.8 11 June 2012 FLIST(1)