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


ADVERTISEMENT

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 :: 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 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

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 :: Copying 1 File To Many Directories?

Jul 25, 2010

The current directory contains:A file called "original.txt" Many directories called "source_001", "source_002", "source_003" ... From the command line how do you copy "original.txt" to "source_001" and "source_002" and "source_003" ...

The total number of these source directories is unknown, it changes every week.

View 4 Replies View Related

General :: Extract Tar.gz File In Other Directories?

Jun 15, 2010

I stay in /var/www/upload and I want extract a file with tar command.

The output of tar xfvz /var/www/file.tar.gz is

Quote:

tar: /var/www/esempio.tar.bz2: funzione "open" non riuscita: Nessun file o directory
tar: Errore irrimediabile: uscita immediata
tar: Child returned status 2
tar: Uscita con stato di fallimento in base agli errori precedenti

View 4 Replies View Related

General :: Tar Multiple Directories Into One File?

May 15, 2011

I have found ways to tar a directory and exclude certain directories but is there a way to simply tar multiple directories (they are in the same directory) in to one .tgz file?

View 8 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 :: How To Flatten Single File Directories

May 1, 2011

I've spent ages trying to build this and had a good look around for a way to do it. I have a directory tree which contains a set of folders and files. Some of the folders contain more than one file but most contain only a single one. I'm trying to move all of the files which are on their own in directories one level below the root into the root. E.g:

Root is: /volume3
Single file in a sub folder: /volume3/20110103/20110103.log
File should end up as: /volume3/20110103.log

I know how to flatten the entire structure fairly easily but its the conditional part which I can't figure out how to do.

View 1 Replies View Related

General :: Specific File Name Renaming In All Sub Directories?

Apr 4, 2011

I have a dir (pub_html) with 45 sub dirsand in each there is a file with name file123.html) what command can I use to rename all files with this name in all sub dirs to file456.html ? I'm on opensuse 11.3

View 14 Replies View Related

General :: Replace A String In Multiple File & Sub Directories?

Aug 31, 2010

Need to replace the following string :

By

In multiple .exp files and in sub directories.

View 5 Replies View Related

General :: Create A Backup Directory And 3 Directories Within That And Some Files Within The 3 Directories And Then Back Them Up Ot Restore Them?

Dec 19, 2009

i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.

View 14 Replies View Related

General :: Multiple Users To Create Directories Over SFTP So The New Directories Keep The Same Permissions?

May 15, 2011

I want to make a webserver with multiple users allowed to login through SFTP to a specific folder, www.Multiple users are added, lets say user1 and user2, and all of them belonging to the www-data group. The www directory has an owner www-data and a group www-data.

I have used chmod -R 775 on the www folder, but after I try to create a folder test through my SFTP server (using Filezilla) the group of the directory created has only r and x permissions, and I am not able to log in with the second user user2 and create a directory within www/test due to a lack of w permission to the group.

I also tried using chmod 2775 on www directory, but without luck. Can somebody explain to me, how can I make it so that a newly created directory inherits the root directory group permissions?

View 2 Replies View Related

General :: Extract To Multiple Directories Based On File Names?

Jan 30, 2009

I'm not sure if this is possible or even where to start. I assume that this can be done with an sh script using tar or similar.I have several very large zip files that contain images for all of the products in my online store. Each image is named after its 13 digit SKU (for example, 9987788000012.jpg). In order to import products into my store, all images are placed into a media directory. Unfortunately, there are over 100,000 images.

So I would like to break the images into sub-folders based on file name. For example, when I extract store_images.zip (or tar or whatever), my extract script would create directories (if they don't already exist) based on the first three digits of each image name, placing each image into the appropriate bottom level directory. For example, "9987788000012.jpg" would be placed in the following directory "media/9/9/8", with media as the root and "8" as the directory that holds any images that start with "998". Perhaps two sub-folders would be less cumbersome.Assuming this requires a script, particularly since it involves scanning image names, creating folders, and saving images to specific directories, which language would serve my needs best? PHP? Has anyone had to do something similar?

View 13 Replies View Related

General :: Restrict Root User To Delete A File Or Directories?

Jan 20, 2011

is there any way so that we can restrict root to delete a file/directories and What is extended file attributes.

View 12 Replies View Related

General :: Command Line - Create Directories That Don't Exist While Creating A New File?

May 8, 2010

I can do:mkdir messages and then: touch messages/hello.txt Is there a command that will do both - create the directory if it doesn't exist, and then the empty file? Something like: touch -p messages/hello.txt

View 1 Replies View Related

General :: Convert All File Extensions For Files In Many Sub-directories From Uppercase To Lowercase?

Sep 21, 2010

I'm trying to convert all file extensions for files in many sub-directories from uppercase to lowercase. I have two problems, how to list the absolute path to the files recursively over many sub-directories for which I so far have this:-

Code:
find ~/Photos -print which would be fine, except it gives the directories on their own when it finds them rather than just the files with absolute paths. I couldn't find a switch for the "ls" command to do this, so I had to improvise with "find". and once I get grab each absolute file name, to just change the file extension rather than the entire file, which is what I have at the moment.

[Code]..

View 7 Replies View Related

General :: How To Store Files / Directories In Different Different Directories?

Mar 23, 2011

I am writing a script, in that my requirement is, if all the fill types stored in one directory from that we need to separate different different directories based on the file types.

for example in a directory(anish). 5 different types files
1- directory
2- .txt files
2- .sh files

like that and my requirement is the (1- directory is moved to one new directory(dir) which we are given in the script)and (2 .txt files are moved to another new directory(test) which we are given in the script)and ( 2 .sh files are moved to another new directory(bash) which we are given in the scrip)finally the directory anish should be empty..using bash script.how it is possible !!

View 7 Replies View Related

General :: Extracting Latest Tar File From The List?

Jan 25, 2010

I have a bunch of tar files in a folder with the name in 'file_name.MMDDYYYY.HH.mm.SS.tar' format. I need to write a shell script that picks latest and greatest of the above tar files and extracts it to a particular folder

View 1 Replies View Related

General :: Samba File List Ordering?

Aug 20, 2009

I've published a samba share on a Ubuntu 8.10 server, and mounted the share on a windows box. For some strange reason the files are not sorted by file name (nor by any other sorting type) if I list them from the Windows command line (dir). I could always use the "dir /on" parameter, but I hope there's a way to make samba sort the files for me

View 4 Replies View Related

General :: Squid Uploaded File List?

Aug 10, 2010

I am using endian firewall 2.4 and squid 2.6, everything is working fine for me. In squid report i am getting download list by user or IP based. Now my question is, is this possible to get user based uploaded file using HTTP POST. Is there any configuration have to be done is squid.conf, if answer is yes then please give me the what is configuration i have to give. Example: if suppose user uploading a image file into facebook.com, i want to track the file name and which IP address and then where its uploaded.

View 1 Replies View Related

General :: List Installed Packages In Debian From A File?

Jun 25, 2010

I have a system that will not boot as /usr has been destroyed and I would like to get a list of installed packages before re-installing. I know that it's possible to get this using dpkg or apt, but I cannot run those.

Where in the filesystem is this information stored and what's the best way to get a list of installed apps from the files?

View 2 Replies View Related

General :: File Command + Total Retrun List?

Oct 30, 2010

With file command we can get the file type. File returns a unique answer for each file type. I want to get the total list that file can return for linux & solaris. For example, I have a partial list of file's return output. Unfortunately I can't see the total list from manual page.

ASCII C program text
ASCII C++ program text
ASCII C program text, with CRLF
ASCII C program text, with very
ASCII English text
ASCII English text, with CRLF line

[Code]...

View 1 Replies View Related

General :: List Of RPM In Text File - How To Check Installation

Dec 16, 2010

I have a text file with a long list of RPM's. I need to check if each RPM is installed. I'm sure I can cat out this file and run "rpm -qa" against it, but I'm having trouble with the syntax right now...

View 5 Replies View Related







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