General :: Moving Files From Folders And Subfolders To A Specific Folder?

Aug 21, 2010

I am using secure delete to remove files from a Debian Linux PC. However, secure delete does not remove folders. This has lead me to look at writing a script that would move files to a predetermined folder for deletion. My plan is as follows:I have a folder on my desktop called shredder where I move the contents of the waste bin to. The script needs to identify all files within the folders and sub folders, within the shredder folder, and move each file to the shredder folder and then delete the folder. At this point secure delete can be used with a command like shred -v -u *.*on the shredder folder.The problem I have is in creating the code to move files from the different folders and then deleting the folders. Note that the names of the files, folders and subfolders will not always be known

View 12 Replies


ADVERTISEMENT

General :: Write A Script To Move Specific Files In Various Folders To One Folder?

Nov 16, 2010

Terribly new to Linux and find it mindboggling. I work on brain imaging and unfortunately all of the analysis runs on Linux, and I do not understand computers well coming as I do from a medical background. So my question - There are various folders of patient MRI scans (folders called P1, P2, P3 etc) and within them are enclosed certain files that I am interested in (always called the same name in all folders, say image001). I would like a script that enables me to copy and move this image001 in all these individual folders to another folder altogether.

View 13 Replies View Related

General :: Copying All .jpg Or .JPG Files From A Folder And All Its Subfolders To /usr/name/pictures Folder?

Sep 10, 2009

How would i go about copying all .jpg or .JPG files from a folder and all its subfolders to my /usr/name/pictures folder? I'm guessing I'd have to use some sort of .[jJ][pP][gG] to get all the pictures from other examples i've seen, but really not sure how to use that in a recursive cp.

View 14 Replies View Related

General :: Change A String Recursively In Files Located In Folders And Subfolders?

Jul 22, 2011

lets say I have a project that have generated lots of xml files. Though all these xml files point to a location with the text name TEXT15. I want to change all the files that containts TEXT15 and change it to TEXT16. This actually works for files in a folder but not recursively in all the entire files....perl -pi -c 's/TEXT15/TEXT16/g' ./* but I have many subfolders and within this more subsub folders....i just want to do this recursively.

View 2 Replies View Related

Ubuntu :: Restricting Users To A Specific Folder And Its Subfolders

Dec 29, 2010

I wanted to restrict users within a particular folder say /var/lib/tomcat/webapps. I want the users to see all subfolders inside webapps and work with it (edit+read but no delete). I understood that chroot is the way, and i read this [URL] community discussion, but what i understand out of it is, they are trying to give a complete working installation of ubuntu to the user within a directory which i dont want to.

View 3 Replies View Related

Server :: Samba Folder Containing Subfolders With Specific Rights?

Jun 5, 2009

Lately I'm getting this question a lot.For every project I want to create a tree like this:

Code:
- project
- drawing

[code]...

View 4 Replies View Related

General :: Move Folders That Contain A File With A Specific Extension To A Destination Folder?

Oct 3, 2010

Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.

View 2 Replies View Related

Ubuntu :: Fine Grained Control Over Specific Subfolders And Files?

Jul 6, 2010

I have been asked by my company management to look into moving file share server from Windows 2003 server OS to Ubuntu 10.4 using Samba. I have successfully configured active directory authentication using winbind and have configured samba and am able to access my file share successfully.

The complication arises as a result of implementing ACL mappings on Linux, as I need fine grained control over specific subfolders and files. From what I have read, I cant map all 13 permissions to respective unix rwx permissions. I have a use case where a certain group called A has read write execute rights on a folder/file but they shouldnt be allowed to delete the specific folder/file. On windows, all I have to do is set up my security permissions to deny 'delete subfolders and files' and 'delete' and it works well. In linux world I understand I cant do this as the user has rwx permissions on the folder/file and he can do whatever he likes.

I googled a lot around this issue and found that if you set up sticky bit on the directory I can still read and write from the file or directory and wont be able to delete it. It works in case of most document types but MS office. From samba help I figured that "Word does the following when you modify/change a Word document: MS Word creates a new document with a temporary name. Word then closes the old document and deletes it, then renames the new document to the original document name." (from samba how to) So if the sticky bit is set on the directory containing word files for instance, linux wont be able to delete the file (as required in write operations by MS office) and hence comes with an error. I shall be highly obliged if some one can shed light on this issue. Alternatively I would love to learn about other solutions for the use case mentioned.

View 1 Replies View Related

General :: List Folder Size And Number Of Files And Folders In Folder?

Nov 23, 2010

In Linux bash shell, for a given directory, how can I list:The create date for that directory The number of files in that directory The number of subdirectories in that directory.

View 3 Replies View Related

Ubuntu :: Copy All Files From A Folder And Its Subfolders?

May 30, 2010

i have a folder with 250 subfolders and each one of them has (at least) one image in it (along with other stuff)how can i 1)copy all the images from those subfolders and paste them into one folder together (other than by hand, obviously)?2)optional : copy only the images of a certain size and above?

View 2 Replies View Related

General :: Copy All Files And Folders From Specific Date?

May 26, 2011

I wanna copy all folders and files created from 01.01.2011 until today to new placeie:cp -r /home/moviecar/public_html/wp-content/uploads/ /home/teaser/public_html/wp-content/uploads

View 4 Replies View Related

Ubuntu :: Move Files From Folder/subfolders To A Different Directory?

Jan 10, 2011

I would like to know how to move all the files from a single folder and its subfolders to a single, different location in as few steps as possible. For example when I download files from one of my school's websites, the file I want is located in a deep sub-directory. So, I have to cd many times just to get to the file I want. Is there a way to recursively move all the files within a folder's subdirectories into a new location?

View 2 Replies View Related

Ubuntu :: Safely Change Permissions For Folder/all Subfolders & Files?

Apr 1, 2010

I just installed Karmic, but I can't copy an old user's home folder (/home/oldusername/) because everything is owned by root.I read but I'm concerned about messing up the system or the files in that old user's folder.So, how do I adjust the permissions of the files in /home/oldusername so that I can use openssh to copy them over my home network to my other computer? I have the ssh part figured out, but the files will not copy to the laptop due to permissions.

View 9 Replies View Related

General :: How To Rename All Subfolders With Specific Name

Jun 11, 2010

How to go through all the subfolders and rename all the folders named 'Old' to 'New'

View 2 Replies View Related

General :: List Of All Nested Subfolders With A Specific Name?

Jun 3, 2010

How to get a list of all the subfolders with a specific name
e.g. all the folders which their name contains 'NAME' code...

but this won't give me a unique list (if the folder has subfolders it gets listed multiple times)

View 1 Replies View Related

General :: Summarized Sizes Of Folders And Their Subfolders?

Jul 11, 2010

Let's say I want to get the size of each folder of a linux file system. When I use ls -la I don't really get the summarized size of the folders.If I use df I get the size of each mounted file system but that also doesn't help me. And with du I get the size of each subfolder and the summary of the whole file system.But I want to have only the summarized size of each folder within the ROOT folder of the file system. Is there any command to achiev that?

View 4 Replies View Related

General :: Get The Summarized Sizes Of Folders And Their Subfolders?

Aug 13, 2010

I want to get the size of each folder of a linux file system. When I use ls -la I don't really get the summarized size of the folders. If I use df I get the size of each mounted file system but that also doesn't help me. And with du I get the size of each subfolder and the summary of the whole file system. But I want to have only the summarized size of each folder within the ROOT folder of the file system. Is there any command to achieve that?

View 3 Replies View Related

Programming :: Search A Bunch Of Files In A Specific Folder For A Specific Number?

Jul 24, 2010

I need to search a bunch of files in a specific folder for a specific number and add all the numbers together to a total sum. I use Rsync everyday, everytime I run rsync i get a logfile (rsync output) witch contains the textstring "Total bytes sent: xxxxxx".

The "xxxxx" can vary in lenght. I need to extract the "xxxxxx" from each file and add the numbers together to a total size over a week or a month. Is this possible? And I wish to only use bash. One way of doing stuff at a time my friends .

View 5 Replies View Related

General :: Copy Files And Folder Except Some Files And Folders?

Jun 8, 2010

I have many files and folders in my source folder. I want to copy some files and folders from that source folder to destination folder. What should be require to given with the "cp" command?

View 1 Replies View Related

General :: Cannot Copy Some Files To Specific Folder?

Jul 20, 2011

sudo cp ../../../rootfs_maker_ramdisk drivers/filesystem/ -rf
give below errorCode:cp: cannot create special file ...._rootfs/dev/hda4': No such device or addressi get this error only in some specific locationsif i dont use sudo then i get permission denied msg

View 4 Replies View Related

General :: Zipping Files Into A Specific Folder?

Dec 24, 2010

I am trying to use the command gzip to compress a directory or file list as argument and compress the file in a file named copia101225, within a directory named ZIPFILES. I want to make sure that if the arguments doesn't exist, the destination directory doesn't exist that it creates it. I keep failing at compressing the file to copia101225, that is within the directory named ZIPFILES This is what I have so far:

#! / bin / bash
# Title: Compress a file
# Author: Jose Miguel Colella
# Description: Compress a file

[code]....

View 14 Replies View Related

Fedora :: Moving Files Between Folders

May 14, 2011

I feel like this is probably a dumb question but regardless, I don't know the answer and my eyes will start bleeding if I keep trying anymore. How do you move files between folders? Dolphin's layout (unless I'm not figuring it out, which is probably the case) doesn't seem to let you drag from one folder to another and there's no other pane to see another folder to drag to.I have an mp3 file in my download folder that I want to move to my music folder but I can't get it to move.

View 1 Replies View Related

General :: File Permission - User Can Create Files/folders In The Shared Folder

May 4, 2011

Is possible to make a folder permission like below?

-User can create files/folders in the shared folder.

-But the files/folders they created, cannot be delete/change by em.
(only can be delete by root users)

-Each new files/folders created will auto owner to root only.

View 4 Replies View Related

Software :: Use Sed To Include A Text File In The Beginning Of Other Text Files Inside A Folder And Its Subfolders?

Jun 1, 2010

Can I use sed to include a text file in the beginning of other text files inside a folder and its subfolders? So it should be recursive.

View 4 Replies View Related

Ubuntu :: Make Certain Files/folders Invisible To Specific Users?

Jan 7, 2011

I've got a NAS running and I'd like to somehow make some of the folders and files invisible to certain users only. For example, if I 'ls' a directory, I want to see files 'a', 'b', and 'c'. But if another user does 'ls' in the same directory, I only want them to be able to see 'a' listed.I know I can use 'chmod +700' to make certain files not able to be read/written, but the filename would still appear in a 'ls'.I know I can put certain files inside of a '.hidden' file in the folder, but then it would be hiEdit : I'd also like to mention that the users that connect to the NAS could be coming from Windows or Mac operating systems. So hopefully the solution would work for users from those systems also..

View 5 Replies View Related

Ubuntu :: Moving Downloaded Files To Correct Folder?

Sep 1, 2011

I'm looking for a script or a bittorrent client which is able to move a file after downloading and placing it in a specific folder depending on the file type. E.g. moving a newly downloaded movie to "Videos" and an ISO-file to "Files".

I feel as if i have used a client with this functionality before but can't remember the name.

Since I at the moment use Transmission as my bittorrent client a script would also work since Transmission can run it after finishing the download.

View 7 Replies View Related

General :: Real Moving Of A Folder's Content To Another Folder?

Feb 7, 2011

Is there a Commend to move the content of a folder -only image files no subfolders- to another destination folder?Actully, I had a look on the following post:Post tilte:Using mv to move the content of one directory into anotherFrom it, I tried that:

Code:
# rsync -a SOURCE/ DEST/
But, it copy a folder as all to the distination.

[code]...

View 10 Replies View Related

Ubuntu :: List Folders And Subfolders With Size?

Jan 2, 2010

I want to list my folders and subfolders (recursive) and also show the size of the files in terminal. I started using this:

Code:
ls -h -R > /test.txt
I got everything but not the size of the folders.
Then I tried this:
Code:
du -h --max-depth=1 > test.txt

Suppose to show me everything, but I can't see subfolders. And this command do not accept recursive. How can I show the size of the files and folders like the second command, but including the subfolders?

View 5 Replies View Related

Software :: Way To Automatically Copy Files Off Of A Cd To A Specific Folder?

Jun 24, 2011

What would be the best way to automatically copy all of the data off of a library of cds to a specific folder on the computer? I was thinking of running a bash script but I've run into a few snags figuring out the correct way to do it. Mainly due to the fact that the cd drive is mounted in a different folder in /media each time I insert a new diskAlso, the mounting and unmounting process causes it's own problems, but I think that could be covered by a for loop that checks /mtab every few seconds or so.

View 2 Replies View Related

General :: Copy Folder Hierarchy / Recreate All Folders From One Directory Without Copying Over Contents Of Folder?

Jul 2, 2010

Is there a way to recreate all the folders from one directory to another without copying over the contents of the folder? I've been trying to do something like this,

Code:for i in `ls $X`; do mkdir $PATH/$i; doneUnfortunately $i is deliminated by whitespaces in the filenames and not the actual folders.

$X contains only other folders so I dont have to worry about regular files but any kind of more "advanced" solution would work.

View 1 Replies View Related







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