General :: Using "find" To List Only Directories With No More Childs?

Oct 5, 2010

How can only directories be listed, that do not have another child directory?

Imagine a structure like /A /A/AA /A/AB /A/AB/ABB /B /C /C/CC /C/CC/CCC /C/CC/CCC/CCCC I would like to use find to list only /A/AA /A/AB/ABB /B /C/CC/CCC/CCCC.

The starting point would be find . -type d, but neither -mindepth nor -maxdepth can be used, can -noleaf help (I could not get it to react the way I wanted it to)?

View 2 Replies


ADVERTISEMENT

General :: List Of Directories In A File?

Apr 3, 2011

I have generated a list of directories that I would like to use ls and grep on, but it is not working. I am using the commandCode:cat directories.dat | xargs lsand I get a whole lot of these errors:Code:ls: cannot access ./foo/bar/baz/grault/*: No such file or directorybut when I try the directories manually one at a time I find that they all exist and all have files in them. Same thing if I try to grep anything. What is going wrong?

View 6 Replies View Related

General :: Find A File In Directories Without Using Find Command?

Aug 3, 2010

am new to linux and trying to find a file in sub directories using find command as:find .-name *.jpg -type fBut I am unable to get the result as find command is not permitted by the server administrator.Is there any way to find files without using find command.

View 14 Replies View Related

General :: Create Directories From A File List?

Jun 30, 2011

I am trying to write a script to pick the directory name from a list of file. Here is a detailed picture.Have a file name LIST which contains the follwing for example/apps/oracle/product/test1/apps/oracle/product/test2/apps/oracle/product/test3I need a script that reads these line from LIST and creates foldersin /apps/oracle/product/test1/backup/date/test1 after reading the first line
/backup/date/test2 after readin the second line/backup/date/test3 and so on.

View 15 Replies View Related

General :: Script To Delete A List Of Directories?

Oct 24, 2010

how to write a short script file to read file (text) contains a list of directories name and delete everything in it. There are 10,000 directories - So there is NO WAY I can do manually.

View 8 Replies View Related

General :: Make A List Of Directories And Files?

Jun 3, 2011

My system is centos 5.5, and I need nobody:nobody's directories and files under data.

There is a directory named "data, and this directory has so many directories and files generated by web program. Most of them is nobody:nobody.

I want to to make a list of these nobody:nobody directories ans files.

Is it possible to make a list of these directories and files?

View 1 Replies View Related

General :: List Directories And Number Of Files Inside Them

Mar 19, 2011

I'm looking for a way to produce a list of all the directories in the current working directory sorted by the total number of files that are contained with them.

Initially I though that Nautilus could be used for this, but then I realised it doesn't count files in the sub directories.

The best I've got for a command line solution so far is this

Code:

The use case for this is a situation where a user has a quota applied to their home directory which limits the number of files they are allowed to have and they have exceeded that limit.

View 4 Replies View Related

General :: List Files In Specific Directories Older Than 1 Day Or 24 Hours

Apr 7, 2011

I am trying to write a simple back up script in python where I try to list the files that are 24 hours old in specific directories that I would choose.I read the manual of find and used

find . -mtime 1 > log.dat

to get the list of files in the log.dat however I also get the path information in that list as such

./hpc06MatlabCodes/2011/Apr/3dBoxModel
./hpc06MatlabCodes/2011/Apr/3dBoxModel/vfluidIrca10.dat
./hpc06MatlabCodes/2011/Apr/3dBoxModel/vLRecoveredSystem.mat

is there a way to exclude the directories and only get the files list.

View 2 Replies View Related

General :: Excluding Directories With Find?

Jun 10, 2011

I am trying to exclude 2 directories with find and pass it into cpio. I have tried

Code:
find . -depth -path '.evolution' -prune -o -path '.gconf' -prune -o -print|cpio -aov > /media/caca/full$date
./.gconf/apps/evolution/memos/%gconf.xml
./.gconf/apps/evolution/memos

[Code]....

View 4 Replies View Related

General :: How To Exclude Multiple Directories In Awk With Find?

May 20, 2010

I found a script on webmaster world that mostly does what I need it to, but have been making modifications to tailor it to my specific needs.I know that //..*/ tells awk to ignore hidden directories, how do I define more directories to ignore? (i.e. temp, var, etc)? I've tried playing with prune before the awk command with limited success...I know that there are many ways to do the same thing and keep running into brick walls.

View 11 Replies View Related

General :: Scripting To Find Difference Between 2 Directories

Dec 17, 2010

Write a script to list all the differences between two directories.

View 1 Replies View Related

General :: How To Use Find To Copy All Found Files To A New Name In Their Same Directories

Feb 23, 2010

I've got a simple command that does almost what I want.

The following will locate all files with a suffix of '_compressed.swf' and copy each into its same directory with a '.bak2' appended:

However, I need to replace '_compressed.swf' with '_content.swf' I'd like to use find, rather than recursive flag on cp for consistency.

Objective
In: /content/somefile_compressed.swf
Out: /content/somefile_content.swf

View 3 Replies View Related

General :: Script To Find New Files And Copy Them Into Different Directories?

Oct 29, 2010

I have a question which has been in part answered many times but nothing I found relateds completely to my situation. I am sure there will be people who will say RTFM but believe me I did, and searched as well but to no avail. I have a situation where I want to copy files created withing last hour in one directory into another one. The problem is that that the directories are on different levels in the dir tree so the absolute path is different. But I want to keep the relative path the same.

I want to copy new files from /mnt/path_to_webdav/user to /home/user. so if there is new file /mnt/path_to_webdav/user/doc/xy.txt I want it to be copied to /home/user/doc/xy.txt. Also if there is a new dir, say /mnt/path_to_webdav/user/newdir I want a new dir to be created in /home/user/newdir with all the files in it, should there be any. I can do find with exec and copy all the files into one directory.This is not what I want though. How do I preserve the relative path and get the files copied into their corresponding directories?

View 1 Replies View Related

General :: Command To Find A Specific Word In Directories And Subdirectories?

Jun 7, 2010

tell me the command used to find a specific word in directories and sub-directories in linux?

View 4 Replies View Related

General :: Make All Files Non-executable Recursively Using Find Without Affecting Directories?

Sep 26, 2010

I need to strip the executable flag from all files within a certain directory and sub directories. Right now I'm doing it with a 2 step process

find /dir/ -type f -exec chmod ugo-x {} ;
find /dir/ -type d -exec chmod ugo+rx {} ;

Is it possible to modify the first line so that I can strip exec flag from all non-directory files? Since this needs to be done on a fairly regular basis across a lot of directories and files, I'd prefer not to use a bash script which would slow it down.

View 1 Replies View Related

General :: Back Up Scrip - Find / Cp / Md5sum / Rm - Move All Files And Directories

Oct 22, 2010

I want to move all files and directories that are 1 month old out to back up into a separate folder. There will be a lot of files and I want to make sure it copies properly. The problem I'm having is integrating a MD5SUM into it to check integrity. MD5SUM is not recursive, so I figured it would work in a loop when it copies each individual file, I'll do a md5sum on each file and delete that md5 once its verified it copied ok.

[Code]...

I also need some sort of error handling to output all md5's that didnt pass the hash check.

View 3 Replies View Related

Programming :: Waiting For Multiple Childs - C - Waitpid?

Feb 28, 2011

I would like to fork more children and then write their return values: so far I tried:

Code:
#include <stdio.h>
#include <stdlib.h>

[code]....

View 7 Replies View Related

Ubuntu :: List Of Directories To Spreadsheet

Oct 23, 2010

I have a large music directory that I'd like to somehow acquire, or generate, a list of each sub-folder within it, and then somehow get the list into a spreadsheet format. Is there a way to do this?

View 1 Replies View Related

General :: Can't Find Bad Blocks List

Jan 6, 2010

I've got a new hard drive, formatted it to ext3, and made a check for bad blocks using e2fsck.

It gave me this:

Quote:

I just would like to know where i can find how many bad blocks were found (perhaps one if it is using singular in sentence "Updating bad block inode."?), and what is/are the number(s) of located bad block(s).

View 3 Replies View Related

General :: Find A List Of Rpm And Yum Apps?

Nov 13, 2010

I downloaded rpm so far but my only problem is I don't know what apps there are for it?

View 14 Replies View Related

Ubuntu :: List Directories By Number Of Inodes Used?

Mar 21, 2010

I recently used up all my free inodes on my server. I had a bunch of mail messages that were sitting there using up a bunch, so I cleared the postfix queue. That gave me some room. What I'd like to do, is get a listing of the directories using the most inodes (or containing the most number of files), so that I can find the other culprits.Basically I want the output of "df -i" but to be able to do it recursively on a specific directory.

View 1 Replies View Related

Ubuntu :: Command To List Directories And Sizes?

Mar 23, 2010

I need a command to list the total sizes for all the directories in a mounted drive.I tried df and du.df list the total size for the mounted drivedu depending on what option I give it either list the total size or list all the sizes for every file on the drive.All I want to know is the sizes of all the directories on the mounted drive.This is a windows vista hard-drive and for some reason ubuntu is reporting a 50 GB partition and only 10GB free, I want to know what's taking up all the free space. I can't find anything in the file browser, so far I've only managed to count up about 10GB of used space so where is the other 30GB.

View 3 Replies View Related

General :: Find Argument List Too Long?

May 12, 2011

I want to search in many many files for a string.

I used find /archive/* -print0 | xargs -0 grep 'robert' -sl

Is there a simple method to do it ?

View 2 Replies View Related

Programming :: Make List Of Directories Which Contain Files Other Than Subdirs?

Oct 17, 2009

I need to, through a bash script, go through a given directory (given as argument 1) to list out the relative path in this directory (including $1) for eact subdirectory which contains files. Directories which only contain . .. and eventually only subdirectories SHALL NOT be listed. It is this last requirement that makes it difficult for me.

I have been using the tree command for now, but I have not found a way to ignore paths to directories which only contains other subdirs or nothing at all in any easy way. I may offcourse test each directory after they are listed but this gives an extra loop to go through and I beleive it should be possible to do it directly when creatring the list. I guess by using find or ls in conjuntion with the tree command or by itself it should be possible but I am not to conversant of nested script commands.

View 9 Replies View Related

General :: Find And List Files Created In A Particular Year?

Jan 31, 2011

How to find and list files and directories present the current directory which were created in, say, years 2005, 2006, and 2009 and then move them to some other location, for example, /backup. Yes, I need to list them and move simultaneously. We can use:

Code:

find . -mtime n {};

but that n is troublesome for me to figure out files/directories created in years 2005, 2006, and 2009, for instance. Is there any way to match exactly by Year Value rather than calulating the "n" (days * 24 Hours)?

System Info:

SunOS 5.8 Generic_117350-06 sun4u sparc SUNW,Ultra-Enterprise

View 3 Replies View Related

General :: Find A List Of Files That Are Named Duplicates ?

Jul 2, 2010

How can I find a list of files that are named duplicates i.e. have same name but in different case that exist in the same directory?

View 7 Replies View Related

General :: Find A File And Just List The Found Files?

Aug 7, 2009

I use find / -name myfile to search files. But it will print out a very long list such as follow:

Code:

...
find: /var/empty/sshd: Permission denied
find: /etc/audit: Permission denied
find: /etc/httpd/conf/ssl.crl: Permission denied
find: /etc/httpd/conf/ssl.crt: Permission denied

[code]....

View 4 Replies View Related

General :: Find A List Of Cronjob Return Codes For Unix?

Jun 24, 2011

Where can i find a list of cronjob return codes for linux/unix

View 1 Replies View Related

General :: Rpm Naming Convention \ Find The List Of Distribution Codes?

Mar 17, 2011

Where would i find the list of distribution codes.For example.Code:samba-32bit-3.4.2 -1.1.3.1.x8664.rpmIn above rpm file it is indicated that its release is 1.1.3.1 .The rpm is meant to be run for opensuse.Where would i get the linking of release number and In simple words How would i guess distribution by merely looking at rpm name?

View 2 Replies View Related

General :: Sending Find Results To File - List Too Long

Aug 12, 2010

I'm trying to do a
find /photos/* -type f -mtime +365
to find all my pictures that are over a year old, but I keep getting argument list too long. How can I view what all the results are, even if it just dumps it to a file that I have to open?

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved