First, the column printed by ls that looks like -rwxr-xr-x indicates the file's permissions and the file type. The type is indicated by the first character: d is directory, - is regular file, l is symbolic link, etc. The POSIX man page lists all of the possible types.
The remainder is three sets of permission flags for owner, group and other. For each set contains the read, write and execute permission (e.g. rwx, r-x, rw- etc.). Again the man page explains all.
The find command you listed does indeed target only regular files. That is what the -type f option does. If you use -type d then it will list directories only. However, it seems that you want a further limitation and only want to list a directory that has no subdirectories. I don't believe that find has that ability.
To list only the directories with no subdirectories, and then list the files in each of those directories, piping the output of find to awk (or similar script) to further limit the list, and then using the ls command to list the directoies is required. Something like this will find all directories in the current directory that do not have subdirectories, and lists their contents:
I am in a fix.......
I have to write a backup script to backup say Folder A.
Folder A contains n folders 1,2 ,3 .....n.
my script should copy A without folder 2 & 3.
Is there anyway I can do it without writing individual copy commands????
Please help.... (1 Reply)
I am in a fix.......
I have to write a backup script to backup say Folder A.
Folder A contains n folders 1,2 ,3 .....n.
my script should copy A without folder 2 & 3.
Is there anyway I can do it without writing individual copy commands????
Please help.... (5 Replies)
Hi all,
Is it possible to find a file on a server without knowing the file path? And when the file is found is it possible to find out the file path?
I would like to find a file by typing: find server/ -name "filename"
Instead of: find server/folder1/folder2/folder3/ -name "filename"
Can... (5 Replies)
I want to create a script which will delete all folders which are over 5 hours old in HP-UX 11.11.
I tried to use the "find" command but it didn't have an option for searching files/folder by hours.
Could some one tell me how to achieve this in HP-UX with only using the standard OS commands and... (4 Replies)
I am trying to make a unix shell script that will make 99 folders 99 deep (counting the first level folders). So far i have made it make the first 99 folders and 99 more in all of the folders. The only problem is the only way i have found is copying and pasting part of the script over and over and... (18 Replies)
I have a folder like this
ls input1
dir1 dir2 dir3 file1 file2 file3
dir1, dir2 and dir3 are sub-folders inside the folder input1
ls input2
dir1 dir2 dir3 file1 file2 file3
My dir1 in input1 folder has files f1, f2, f3 and f4.
My dir1 in input2 folder has file f4 and f5.
... (3 Replies)
Hi
Can i archive folder and folders in with the tar command
My files are located in subfolders
Eg: Folder1/Folder1_1/*.pdf
Folder1/Folder1_2/*.pdf
Folder1/Folder1_3/*.pdf
so i would like to tar all the files in Folder1_1 and Folder1_2 only not Folder1_3 that should be done next... (2 Replies)
I am trying to cat 3 files. They all have the same name MFExtract.txt. But, they are in 3 seperate file names. Any idea how I could cat the 3 together. It's throwing me off figuring out a way because the names are the same. I was thinking just doing a 3 cat commands with the full path names and... (2 Replies)
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
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)