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


ADVERTISEMENT

General :: Linking Init Script To Specific Rc0.d, Rc1.d Etc Directories?

Aug 20, 2010

I have written an init script which I have kept under /etc/init.d, I need to create links to the directories rc0.d, rc1.d, rc2.d, rc3.d etc.. So that I can use chkconfig command to control the starting and stopping of the script at specific runlevels.

View 4 Replies View Related

General :: Recursive Delete Specific Files From Sub-directories?

Mar 4, 2011

I would like to be able to recursively delete specific various files from a directory and sub-directories. For example:

Dir/
|_sub1/
|
|_ _rm *file1 *file2 *file3

[code]....

View 11 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 :: 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 :: Command For Listing Files/dirs Recursively Of Specific Directories?

Jul 22, 2011

suppose in my current directory, I have 50 sub-directories. Now, I am interested only in about 20 of those sub-directories (whose names match a pattern). I would like to recursively list the contents of these 20 sub-directories. How do I do that ? I would like to do this in Solaris 10 and Linux(RHEL 5.x).

View 3 Replies View Related

General :: Assign Read Privileges To User On Specific Directories And Files

Jan 26, 2011

I am using CentOS 5.5 and I created few users (useradd john etc.) and now I want to assign privileges to this user on some directories and files in those directories. For example I want to give read privileges to directory "/documents" and all of files under that directory.

View 13 Replies View Related

General :: Renaming A File Other Than Using Mv?

May 28, 2011

I was wondering is there another way of renaming a file aside from using mv in linux?

For example changing /home/usr/blah.txt to something like -home-usr-blah.txt

View 4 Replies View Related

General :: Renaming File Right Access?

Apr 13, 2011

the permission of 'renaming a file' is included in which right: 'read', 'write' or 'execute'

View 1 Replies View Related

General :: Renaming File Permission Chmod?

Apr 11, 2011

that works to disallow non-owners from renaming the file, but what I wouldlike to do is disallow EVERYONE ( including the owner of the file ) fromediting, moving, or changing the filename once it is created. the only personwho should be able to make those changes is a special user.

View 13 Replies View Related

General :: Copy A File X Times Renaming It With All Alphabet Letter?

Sep 11, 2011

this seems to be a strange question, i know. I've a database sqlite file called "a.db".I need to copy it 20 times (1 time for each letter of the alphabet) to have : b.db, c.db , d.db.

View 1 Replies View Related

General :: Renaming Files With Sed - Mv: Missing Destination File Operand After `$i'

Mar 20, 2011

Today i am trying to learn how to use sed. I set up a testing folder with the following files:

AAb.lol
AAc.lol
AAx.lol
test.sh

My goal is to create a script (test.sh) which renames all the files to their original name without AA. I want to end up with this:

b.lol
c.lol
x.lol
test.sh

sed seemed to be the perfect tool so i went ahead and created a script which i think should clear the job.

[Code].........

mv: missing destination file operand after `$i' From that 2nd line i can tell that $NewName is just empty. I also read something about sed needing the -e option for scripting purposes but i just don't understand it.

View 7 Replies View Related

Software :: Using Find To Only Search Specific Directories?

Jan 9, 2010

how the "-prune" option works. I've searched quite a bit on line, and as far as I can tell, "-prune" works exactly the opposite as it says.

I'm using Apt-proxy, and I want to scan through the folders, and find files that end with "*.bz2" The problem is that the search takes a while because of all the "*.deb" files. Fortunately, they're stored in their own folder:

/var/cache/apt-proxy/ubuntu
/var/cache/apt-proxy/ubuntu-security
/var/cache/apt-proxy/partner
each have two folders:

[Code]....

View 5 Replies View Related

Red Hat / Fedora :: Script Will Create Directories For A Specific Datatype?

May 24, 2010

1. This script will create directories for a specific datatype. Example rickk, rik, rikky etc.2. This script will aslo create subdirectories labeled by the duration of an event.For example if an event where to take place for 5 days, May 5 - 10th. Folders will be labled:20100505, 20100506, 20100507, etc will be included in each datatype.Since this exercise will take 6 days there will be 6 subdirectories under each datatype.3. This script will also create cgi scripts for each of the dataype and day of the the exercise.For example dataype "rik" for May 09 will read rik5.cgi, since May 09 is the 5th day of the exercise.This is how it looks so far, it works great but I realized that if and when I plan to add more datatypes that its going to involve alot of repetivie typing. I figure to simplify this whole thing would be best to use loops. Can someone direct me to some good information concerning loops and sample of loops? I have a feeling that what I need to do is going to involve a nest of loops.

#!/bin/ksh
root_dir=/opt/global/webservices/apache/app/test/dynamic/
cd $root_dir

[code]....

View 1 Replies View Related

General :: Find Folders With ONLY One Specific File In And Delete File And Folde

Oct 21, 2009

Many folders within a subdirectory some of which have lots of data in and some of which have only one specific file called produkt.fil inside.I need a command to find and delete those folders that contain ONLY the file produkt.fil - if other files exist (doesnt matter what they are) then they should be left alone. Note: produkt.fil exists in all of the folders always.

View 5 Replies View Related

Software :: Create Certain Files And Directories With Specific Owners On The Target Machine

Jun 29, 2010

I'd like to create a tar file on my machine to distribute software to other machines which are all alike (including, usernames, groupnames, etc). I need to create certain files and directories with specific owners on the target machine. In order to do that, I use

Code:
tar --create --owner=someone --group=somegroup --file package.tar files. However, for this to work, someone must be in my /etc/passwd and somegroup must be in my /etc/group. Is there a way to fake this so I don't have to create a bunch of users only for that purpose?

View 3 Replies View Related

General :: Rename A File By Replacing Specific Letters In The File?

May 11, 2010

I used a script that renamed my file eg 'echo webutil.olb | tr [A-Z] [a-z]' i wanted to rename it back to webutil.olb. How do i do this for many other files that i have

View 3 Replies View Related

Ubuntu Servers :: Change The Ownership Of Multiple Files And Directories Under A Specific Subdirectory?

Feb 19, 2010

I have a vary unique problem with file and directory ownership. I need to change the ownership of multiple files and directories under a specific subdirectory.Under this directory structure there are files and directories owned my different users and groups. I need to change all files and directories owned by "user1" to "user2". but if any are owned by "user3" I need those left alone.Is there a simple way to do this or will I need to traverse the structure and change things one at a time.

View 3 Replies View Related

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

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

Ubuntu :: Renaming The Smb.conf File?

Apr 5, 2011

I am trying to follow the instructions in the smb.conf file which says, "name original file smb.conf.master and create the "real" config file with test parm -s smb.conf.master >smb.conf".

First I made myself the owner of the smb.conf file. Then I tried to rename the smb.conf file to smb.conf.master. When I try to do this with: rename smb.conf smb.conf.master the result is: Bareword "smb" not allowed while "strict subs" in use at (eval 1) line 1.Bareword "conf" not allowed while "strict subs" in use at (eval 1) line 1.

Can someone tell me what this means, (why it is happening) and what do I need to do in order to rename the smb.conf file to smb.conf.master.

View 6 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

Ubuntu :: Deleting File While Renaming / Recover These?

Feb 25, 2011

This has happened twice to me. I'm editing a filename on the desktop, for example, I have a part of the name highlighted and press delete. Inadvertently, I press delete again, but with nothing highlighted. The file is deleted, but is not added to the recycle bin (possible bug).

I believe that is what is happening. I cannot seem to recreate it purposefully on my work computer --I had done this at home this morning while sans-coffee.

Is there a way to recover the files?

View 1 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







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