I 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.
How 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 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...
I recently installed vsftpd on my server. I noticed that users on the machine can login into vsftpd with their username and password on the machine and go to their root dir "/home/username".Now, I want to give some people a vsftpd username and password so they can upload and download files and folders to their folder, but this folder has to be in the "/var/www/(username)" folder. I don't want them to be able to go to any other folder than their own folder like "/var", "/etc" or "/home" etc. Also I don't want them to be able to login on the machine as a user, through putty for example. They should only be allowed to acces their folder with vsftpd, nothing else.
I 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.
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.
I'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.
I'm planning to writing a script to rename files recursively.
To be said that I'm using /bin/sh (not /bin/bash) as this is the only shell available on the busybox of the linux router (tomato) I'm using.
Basically I would like to rename files with extension .jpg using as a suffix the filename of another file in the very same directory with extension .avi
The reason for this is because pretty much all the DLNA devices like modern TV playing .avi files will display a thumbnail of the video when browsing the filesystem, however to do so they'll need .jpg image wit hthe same filename of the video in the very same directory.
I am happy to report I successfully setup a cloning station using Ubuntu 10.4 Lucid Lynx and Clonezilla. I learned the hard way you have to restore images to a hard drive of a larger size than the drive the image was ripped from. I had already ripped 6 or more images and have them in the Home_Partimag folder and cannot delete or rename these images. I want to remake these images and rip them from smaller hard drives. Any commands I can use to be able to do this?
I am using hte rename command to clean up a bunch of files. I know you should be able to use regex with the rename command, but it seems to ignore them.Most of the time I am using something like:rename 'something' 'some' *Now lets say I have files named:
Its very easy to rename a flash disk or even a memory card or any storage in windows because all you have to do is right click on the disk and an option is there rename, I have failed to find a way of doing this in linux ubuntu 8.04, but I understand its possible even in the command line, how to do this, I need to rename my flash disk.
I'm currently trying to make a script to rename all the files with one provided file extension to a second provided file extension. I've achieved this by commanding "sh newext doc txt" with the following which works perfectly:
#!/bin/sh for f in *$1; do mv "$f" "`basename "$f" $1`$2"; done;
However, I'd like to be able to modify what I've written so far, so that I can choose whether to convert file extensions in a subdirectory or not. For example, I could enter "sh newext -r doc txt" and the subdirectory's files would also be affected by my script, or enter "sh newext -n doc txt" which would only affect the directory I'm in.
I have to do a very simple task but being a newbie, its becoming a challenge Here is what I have to do:1. I have a bunch of *.html files most of them are duplicates: file1.html, file6.html and file12.html could be duplicates.2. I have to eliminates the duplicates by using the cksum and rename the files by using the sum™ value (sum.html)Something like:
I get a bit lazy using cUrl, often letting downloads go without adding the proper extension to images and whatnot. Yes I know about the -O flag, but I'm the kind who likes to give my files unique names right off the bat (until they puzzle out a way to "stamp" files with originating URLs across platforms, Classic MacOS Web-browser style, curl -o is the way to go). So I was hoping someone could help me write a script (bash or python, doesn't matter which) that used the file command to look inside files in a single directory and then rename the ones it happened across that didn't have a 3- or 4-letter extension, appending the one that corresponded with the mime type. But this action only to be performed on files with no extension.
I know Linux and Unix don't bother much with extensions. I started home computing on a Mac IIcx -- that kind of intuition is beyond natural for me and very much appreciated. But I, and a few of my friends and family, alsose Windows where file extensions are an idiot-proof way, if nothing else good can be said about the two, to get file X to open in application Y and not Q, W or Z (or, worse for some, no application at all).I've seen a few scripts in different places, but they all seem to have the flaw of renaming files that already have an extension
I recently (and accidentally) wiped a hard-drive which should NOT have been formatted. PhotoRec was able to recover some of the most important files from the disk.
Part of those files include a large music collection of flac files. I've placed these in a folder named 'FLAC' that looks like this:
[Start of FLAC Folder] f11655088.flac f11698672.flac ... (around 2,000 files total) f291142600.flac [End of FLAC Folder]
I'm running a livecd to rescue this data. I have access to a standard terminal in Ubuntu 10.10. I've noticed that the music player in linux will display the song title when I open any of these songs.
My goal is to automatically extract the song title from these files and update their names from f12313512.flac to 'Libera - Rebirth.flac'
I have files whose names look like this:Sim1-2_40.36.chr20_sb.foo.indel.novoalign.samSim1-2_40.36.chr20_sb.foo.indel.bwa.samWhat I want to do is to replace all indel with snp in the namesyieldingSim1-2_40.36.chr20_sb.foo.snp.novoalign.samSim1-2_40.36.chr20_sb.foo.snp.bwa.samBut why this unix command doesn't work
I have a batch rename task and I find the 'rename' command in Ubuntu and Fedora is different.In Ubuntu, rename is written in Perl and has regexp support. Is there anyway to install it on Fedora?
I have a bunch of photos with varying names. I want to give each photo a random name(*), how do I do that? (*)I'm going to put them on a digital photo-frame that can't shuffle
I recently had data recovered and it was sent back to me on what I think is an NTFS drive. I copied all the files over to a file share I have on a Linux box, that's ext4. Now I have that share mounted on my OSX machine, and I can't move or rename most of the files. However, in a couple cases I was able to rename a folder after the third try. Another time I was able to rename a folder once, but not again. All the permissions are showing up the same on the command-line -- I can't see any differences between the permissions on any of the files/folders. Note that I can create new folders and add files no problem, and then rename and move those all I want.
I need a either a script or perl script that will allow me to mass rename files, folders, and sub folders. I need to replace special chars in the current file names with underscores. I was able to make this happen in a single directory, but not recursively.
Here is what does it in a single directory.
for file in * do mv "$file" $(echo "$file" | sed 's/[^A-Za-z0-9_.]/_/g') done
I'm trying to write a script to process some images and rename them, or more specifically, renumber them so that pg_0001.png becomes pg_0.png, pg_0002.png becomes pg_1.png, etc. I've looked at the rename command and sed, but I'm not really very familiar with these. It should also be part of a bash script that I've written for the processing of these files - this is what I have so far:
Y want to rename a bunch of files and directories to remove the space on the names, easy enough right?
Code: for source in $(find ./); do target=$(echo "$source"|sed -e 's/ /_/g'); mv -f "$source" $target; done
Well, I thought that should have work but the problem is that $source comes up broken, when I run it with echo instead of mv I get the echo with broken names.
Code: In this case "$source"="This is the file I want to rename" $ echo "$source"
I have a large collection of music albums sorted in folders which are named like this: "Zombie Ritual - 2004 - Night Of The Zombie Party" (%{artist} - %{year} - %{album}). I want to rename them so as to be indicative of the bitrate, for example, "Zombie Ritual - 2004 - Night Of The Zombie Party" => "Zombie Ritual - 2004 - Night Of The Zombie Party (@320)". It will be hard to do this manually. I tried to use EasyTag and Kid3 to do this, but they cannot add bitrate to tags.