General :: How To Rename All Subfolders With Specific Name
Jun 11, 2010How to go through all the subfolders and rename all the folders named 'Old' to 'New'
View 2 RepliesHow to go through all the subfolders and rename all the folders named 'Old' to 'New'
View 2 RepliesHow 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)
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 View RelatedI 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 RelatedLately I'm getting this question a lot.For every project I want to create a tree like this:
Code:
- project
- drawing
[code]...
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.
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 RelatedLet'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 RelatedI wrote a script for copying mp3 files to my girlfriend's mp3-player and it looks like this:
Code:
mount /dev/sdc /test -o sync
for i in *.mp3; do
[code]...
I have scripts in folders /opt/apache2/tools/ and also i have another folder called IDM under /opt/apache2/tools. i tried to configure htpasswd for just IDM folder only as below.
bash-3.00# pwd
/opt/apache2/tools
bash-3.00# ls -al
[code]...
Is there a way to allow other members of my group to access subfolders under my home directory, but not my home directory itself?I'm using CentOS 5.4
View 3 Replies View RelatedI 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 Relatedfor example
else {
for fileDOC in $location/*.doc
do
[code]...
I want to rename files in multiple subfolders with a prefix (e.g., rename "file.tif" with "prefix_file.tif") and not have to be in the subfolder.
code: for f in /path/to/*; do echo mv "$f" "PRE_$f"; done
gives you this: mv /path/to/file1 PRE_/path/to/file1
instead I want this: mv /path/to/file1 /path/to/PRE_file1
I'd like to copy a file, say widgets/water.txt, to all subfolders in the folder widgets using a single command. So if the folder widgets has 10 subfolders like widgets/blue, widgets/green, etc. I'd like to copy water.txt to all of them with one command.
I tried the commands
Code:
cp water.txt ./*/water.txt
cp water.txt ./*/
However these don't seem to work. The latter gives 'cp: omitting directory' errors.
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 RelatedHow would I rename all files with a leading decimal point recursivley? I some how got all my music files to have a decimal point.I tried the below and got a " sed argument to long".[CODE]find /media/MUSIC -type f -name "*.wma" | xargs -0 sed -i 's/.(.*)/1/'[CODE]
Another question, can i just use -type f with out -name ? I am sure that all the files got the decimal point added as the first character.
I want to record an internet radio station starting at 2:00am tomorrow morning. The specific program on the radio station lasts until 6:00am. The command I need to run to record the station is: Code:mplayer http://wjcu.jcu.edu:8001/listen.pls -ao pcm:file=indie_heat_of_the_night.wav -vc dummy -vo nullI'd use cron, but 1. I'm not sure how to and 2. it seems unnecessarily complicated for something that I only want to run once. If cron is the only/easiest solution, I guess I'll just have to resort to that, but I'd rather not.
View 12 Replies View RelatedHow 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 RelatedI accidently created an account with the wrong username. I need to change it to something else. I never done this before but I think you can issue this command "usermod -l login-name old-name" which only changes the username nothing else.I know I will also need to change the home directory to reflect the changes but I am not sure what to do.
View 4 Replies View RelatedI need help with renaming files and folders in one go.
I have a folder called /opt/utility/pictures/
Inside that folder have sub-folders and files such as code...
At the time of installation UBUNTU 9.04 ,I just create 4 partition from 80GB hddi.e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6079 48829536 83 Linux
/dev/sda2 6080 9729 29318625 5 Extended
[code]...
What is the ssh commands to rename a group of files?
I need to rename:
avatar_01.jpg
avatar_02.jpg
[code]....
How would I rename a file say old.txt to new.txt in Linux using commands?
would it be...?
rename old.txt new.txt
I just installed Linux on a second partition. The label of this partition is currently " newlabel " i want to change this to "linux" how to do this.
View 2 Replies View RelatedI am running Linux and I have some basic console knowledge but my current problem is quite difficult and I dont know how to achieve this. I want/need to rename everything within a folder that matches a given string.
By everything I mean:
folders/files
content within a file
content in hidden files
Basically I want to refactor a Java-project. Sure, I could use Eclipse to handle the replacing, but this leaves out the folders or resources outside of my workspace. I was thinking of a script that could do the job for me but this seems rather tricky. For instance when it comes to folder-/file-rename I want to replace only the part of the name that matches my string, the rest should remain untouched.
I have a bunch of images named:
1.jpg
2.jpg
317.jpg
317 (2)a.jpg
etc.
In my file browser (Nautilus), they are displayed in the correct numerical order. However, in Brasero when I order them, it orders them strangely (correctly, but not the way I want them to). They order like this:
1
10
100
101
[Code].....
Can someone recommend a naming convention to rename all these files to so they are in the correct order (for example, cameras use IMG_xxxx.JPG, which is nice)?
Can someone give me a Linux command line rename command for these files so they are renamed to display and therefore burn in the correct order?
They're standard JPEG files, so ordering them by the date in the EXIF data might work. I just need the correct commands, or GUI - I don't mind - to get them in order.
Is there any method to automatically renaming a file when it is automatically put in a shared file in samba on debian ?
View 1 Replies View RelatedIs it possible to rename a process that is currentley running i.e. from "batch.sh" to "donotkill" etc
View 4 Replies View RelatedI'm trying to clean up some files and I've been using the rename command as its the easiest way I've found to do it. One problem I've found is that on a couple of batches of files they have a set random numbers on them which I need to remove.
Only problem is I can't find a way for rename to "lock" onto those numbers to remove them. The file name structure is something like this:
file name[random numbers].extension
There are brackets around the numbers as well which I'm not sure will help or not.