Sponsored Content
Top Forums Shell Programming and Scripting choosing a random folder in a folder Post 302623683 by yazu on Saturday 14th of April 2012 10:24:19 AM
Old 04-14-2012
Try
Code:
find FOLDER -maxdepth 1 type -d

instead of
Code:
ls -l FOLDER

This User Gave Thanks to yazu For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse the .txt file for folder name and FTP to the corrsponding folder.

Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)
Discussion started by: MeganP
3 Replies

2. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

3. Shell Programming and Scripting

script for Finding files in a folder and copying to another folder

Hi all, I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt. I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Discussion started by: satish2712
5 Replies

4. Windows & DOS: Issues & Discussions

How can I upload a zip folder on a unix path from my windows folder?

Hello, I am an amature at UNIX commands and functionality. Please could you all assist me by replying to my below mentioned querry : How can I upload a zip folder on a unix path from my windows folder? Thanks guys Cheers (2 Replies)
Discussion started by: ajit.yadav83
2 Replies

5. Shell Programming and Scripting

File Management: How do I move all JPGS in a folder structure to a single folder?

This is the file structure: DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg DESKTOP/Root of Photo... (4 Replies)
Discussion started by: guptaxpn
4 Replies

6. Shell Programming and Scripting

copying random Jpg files to different folder

Hi, I have 200 pictures in a folder and I would like move 10 random pictures every week to given folder automatically. I have this server on 1and1.com. So I tried the following using Bash script for manual copy and paste for testing #!/bin/bash mapfile -t -n 3 files < <(find... (13 Replies)
Discussion started by: raamkum
13 Replies

7. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

8. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

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)
Discussion started by: srivarun15
6 Replies

9. Shell Programming and Scripting

Delete oldest folder based on folder named as date

Hi, I have a script doing backup to synology server, the script create new folder each day with the date as being folder name i.e. 2018-07-30. Just before creating the new folder I want the script to find the oldest folder from the list and delete it including its content. for example... (3 Replies)
Discussion started by: humble_learner
3 Replies
folders(1)						      General Commands Manual							folders(1)

NAME
folders - list folders and contents (only available within the message handling system, mh) SYNOPSIS
folders [+folder] [msg] [options] OPTIONS
Lists only the name of folders, with no additional information. This is faster because the folders need not be read. Prints a list of the valid options to this command. Lists the contents of the folder-stack. No +folder argument is allowed with this option. Re-numbers mes- sages in the folders. Messages are re-numbered sequentially, and any gaps in the numbering are removed. The default operation is -nopack, which does not change the numbering in the folder. Discards the top of the folder-stack, after setting the current folder to that value. No +folder argument is allowed with this option. This corresponds to the popd operation in the C-shell; see csh(1). The -push and -pop options are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other. Pushes the current folder onto the folder-stack, and makes the +folder argument into the current folder. If +folder is not given, the current folder and the top of the folder-stack are exchanged. This corresponds to the pushd operation in the C-shell; see csh(1). The -push switch and the -pop switch are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other. Lists folders recur- sively. Information on each folder is displayed, followed by information on any sub-folders which it contains. Displays only the total number of messages and folders in your Mail directory. This option does not print any information about individual folders. It can be sup- pressed using the -nototal option. The defaults for folders are: +folder defaults to all msg defaults to none -nofast -noheader -nototal -nopack -norecurse DESCRIPTION
The folders command displays the names of your folders and the number of messages that they each contain. The folders command displays a list of all the folders in your Mail directory. The folders are sorted alphabetically, each on its own line. This is illustrated in the following example: Folder # of messages ( range ); cur msg (other files) V2.3 has 3 messages ( 1- 3). adrian has 20 messages ( 1- 20); cur= 2. brian has 16 messages ( 1- 16). chris has 12 messages ( 1- 12). copylog has 242 messages ( 1- 242); cur= 225. inbox+ has 73 messages ( 1- 127); cur= 127. int has 4 messages ( 1- 4); cur= 2 (others). jack has 17 messages ( 1- 17); cur= 17. TOTAL= 387 messages in 8 folders. The plus sign (+) after inbox indicates that it is the current folder. The information about the int folder includes the term (others). This indicates that the folder int contains files which are not messages. These files may be either sub-folders, or files that do not belong under the MH file naming scheme. The folders command is identical to the effect of using the -all option to the folder command. If you use folders with the +folder argument, it will display all the subfolders within the named folder. as shown in the following exam- ple: % folders +test Folder # of messages ( range ); cur msg (other files) test+ has 18 messages ( 1- 18); (others). test/testone has 1 message ( 1- 1). test/testtwo has no messages. TOTAL= 19 messages in 3 folders. See refile(1) for more details of sub-folders. RESTRICTIONS
MH does not allow you to have more than 100 folders at any level in your Mail directory. PROFILE COMPONENTS
Path: To determine your MH directory Folder-Protect: To set protections when creating a new folder Folder-Stack: To determine the folder stack lsproc: Program to list the contents of a folder FILES
The user profile. SEE ALSO
csh(1), folder(1), refile(1), mhpath(1) folders(1)
All times are GMT -4. The time now is 10:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy