Ubuntu Networking :: Bulk Renaming Files On A SMB Share?

Jan 23, 2011

I have a Netgear ReadyNAS NV in the basement, that I want to use to serve up video files over my network to a TV in the living room.

Now, I have a lot of files that HandBrake encoded and it gave the files an m4v suffix. Even when the files are in a codec that the TV can handle, it refuses to load them because of this suffix... so I want to rename them all.

This is fairly simple for files on a local filesystem. I can simply cd into the directory containing the files, and do something like the commands below.

Code:
$ for a in `ls`;
> do
> stem=`echo ${a} | cut -f1 -d"."` ;
> mv ${a} ${stem}.mpg ;

[Code]....

Although there are a few smb commands available (smbstatus, smbget, etc.), I've not found any commands like smbls or smbmv.

Are there any special commands or utilities around that can do the kind of thing I'm trying to do?

View 1 Replies


ADVERTISEMENT

Ubuntu :: Renaming Files In Bulk - "mv" Command Is Failing

Jun 23, 2010

I have following files:

# ls -1 *.mp3
Megadeth - Killing Is My Business...And Business Is Good! - 01 - Last Rites-Loved To Death.mp3
Megadeth - Killing Is My Business...And Business Is Good! - 02 - Killing Is My Business...And Business Is Good.mp3
Megadeth - Killing Is My Business...And Business Is Good! - 03 - Skull Beneath The Skin.mp3
[Code]....

i want to rename it to:

01 - Last Rites-Loved To Death.mp3
02 - Killing Is My Business...And Business Is Good.mp3
03 - Skull Beneath The Skin.mp3
04 - These Boots.mp3
05 - Rattlehead.mp3
06 - Chosen Ones.mp3
07 - Looking Down The Cross.mp3
08 - Mechanix.mp3

here is my RnD so far:

[Code]....

so it does show that i can run "mv" and reame the files the way i want. BUT...there are lots of spaces in each file, and hence when I append "|sh" to above command to have him actually rename the files, my "mv" command is failing. BTW, I tried exploring perl "rename" command, but I could not understand it's regex.

View 3 Replies View Related

General :: Copying Bulk Files From One Server To Another

Sep 30, 2010

I need to copy a large number of files, it comes to 1 lakh from one server to another. When I tried various commands using scp , ftp etc. It is saying "Arg list too long". In which way can we copy all the files. The Two servers are under Linux.

View 4 Replies View Related

Ubuntu :: Write A Script To Go Through And Delete Bulk Duplicate Files?

Jul 7, 2010

I am using my Ubuntu machine to serve as a media server and network storage. The problem I have is iTunes on my desktop managed to make 2 copies of every song on the machine so instead of the 30GB I have its up to almost 100gb. I was wondering if there was a way to write a script to go through and delete the duplicates. The duplicates are the same filename as the original except a 1 or 2 following. Wasn't looking forward to deleting 12,000 files by hand.

View 1 Replies View Related

Fedora :: Bulk Rename Files In A List Via Terminal?

Nov 12, 2009

I've been spinning my wheels for a bit on this one not getting any traction. I have a list of pictures that have a bad extension that I would like to rename with the good extension. Here's a snippet of the list that I'm looking at:

listold
Code:
/Volumes/MyFiles/Pictures/2009/02 - February/Qeirstyn Playing Inside/._IMG_3347.JPG
/Volumes/MyFiles/Pictures/2009/02 - February/Qeirstyn Playing Inside/._IMG_3349.JPG
/Volumes/MyFiles/Pictures/2009/02 - February/Qeirstyn Playing Inside/._IMG_3350.JPG
/Volumes/MyFiles/Pictures/2009/02 - February/Qeirstyn Playing Inside/._IMG_3354.JPG

[Code]....

View 6 Replies View Related

Ubuntu :: Renaming Files Through Bash

Feb 10, 2011

I'm trying to rename ~11000 files. What has happened is I have files in the following format:

string1_100_string2_200_string3_300.log

now the numbers 200 and 300 are sometimes below 100 and the file looks like this:

string1_100_string2_99_string3_99.log

and I want to rename such files to be like this:

string1_100_string2_099_string3_099.log

I wrote a small matlab script but it seems to take forever so thought I'd try and do it bash and have got near to nowhere....

View 3 Replies View Related

Ubuntu :: Renaming Downloaded Files - Adding '

Jan 11, 2011

Whenever I download a file using Firefox or Google Chrome and it has a ' character on it's filename, the file is renamed and a is added before the '. It's really annoying and I'd like to know how can I solve this issue.

View 9 Replies View Related

Ubuntu :: Renaming Files By Shotwell 'title'?

Mar 31, 2011

I've used Shotwell to give titles to a lot of photos, and now realise that I want to also rename those files using the title. I see that Shotwell saves the title into XMP IPTC structure, using this: dc:title[x]. how to batch rename a bunch of files using this data?

View 3 Replies View Related

Ubuntu Networking :: Find Directions On Networking Two Computers Together In Order To Share Files?

Nov 20, 2010

I am having a heck of a time trying to find directions on networking my two computers together in order to share files. I have two machines running Ubuntu 10.10 Desktop & Netbook remix.

They are both connected to my wireless router to connect to the internet.

View 9 Replies View Related

Ubuntu :: Script For Renaming Files Giving Them The Name Of The Folder They're In?

Feb 2, 2010

I have a folder where all of my movies are placed. Each movie lies in its own folder. I want to write a script which renames all the movie files and gives them the name of the folder they are in.For example I want this file:/home/tryfon/movies/Black Irish [2007]/black.irish.dvdrip.avi to be renamed to /home/tryfon/movies/Black Irish [2007]/Black Irish [2007].aviOne issue is that the video files are of several file types (mostly avi, divx and mkv).Another issue is that some movies consist of two parts, so if a second avi file is found I would like the two (or more) files to be named like: "Black Irish [2007] CD1" and "Black Irish [2007] CD2", or if this is not possible at least notify me of the folders that contain more than one video fil

View 2 Replies View Related

Ubuntu :: Mass Renaming Files - Get Rid Of Two Extra Characters On The End

Feb 12, 2010

I have a folder with various subfolders of files. These files all have two extra characters on the end that I want to get rid of. How would I go about telling the terminal to go into X directory and every subdirectory of X directory, look for all files with the extra characters, remove them, and keep everything else the same?

View 3 Replies View Related

Ubuntu Servers :: Renaming Files Recursively From Folder

Mar 26, 2011

I'm trying to rename files recursively from a folder. I want to delete the & from every filename. i've searched the net and found the following script:

Code:
#!/bin/bash
dir=/whatever/directory
for file in `ls $dir` ; do
# ANYCASE TO UPPERCASE:
newname=`echo $file | tr '[a-z]' '[A-Z]'`
mv $dir/$file $dir/$newname
done
and changed it:

Code:
#!/bin/bash
dir=/home/test
for file in `find $dir -type f` ; do
#rename files containing &
newname=`echo $file` | tr '[&]' ''
mv $dir/$file $dir/$newname
done

But the for loop explodes the filename after each & sign, so i don't have a whole filename. if the file is named lorem & ipsum, the for loop will break it in 3 parts.

View 2 Replies View Related

Ubuntu Multimedia :: Renaming Recovered Music Files

May 18, 2011

I managed to very stupidly (and avoidably) overwrite the hard drive that contained all my stuff--music, photos, home videos from the 80's that were painstakingly converted to digital movies, etc.After running Photorec and recovering much of the data to another disk, I'd like to be able to rename the music files using whatever exif data/tags are available.

View 6 Replies View Related

Ubuntu :: Renaming Multiple PDF Files (Replacing Sign)

Jun 21, 2011

I have many pdf files which contain "%" sign also in the name. I want to rename that all files by replacing "%" to "-" Its hierarchy of many files and folders. Is there any solution to do this at one time? OR any script for this?

View 7 Replies View Related

General :: What's The Command For Renaming Files

Jun 8, 2010

What's the command for renaming files? I thought it was "mv"--I typed "info" and read

Quote:

* mv: (coreutils)mv invocation. Rename files. So, desiring to give a .JPG extension to a jpeg file that had no extension (because I dug it out of my Firefox cache), I typed

Quote:

mv '/home/josh/Desktop/Natalie pictures/DEC8FFA5d01' *.jpg

That didn't rename the file; it made the file disappear from its folder. What did I do wrong?

View 6 Replies View Related

Software :: Renaming Or Copying Some Files?

Apr 19, 2011

i have some files on my server that i can not rename or copy it seems file names are some how strange for linux (centos)the names are like this way :

Spirited.Away.2001.HDRip_-_(Film98-Net).mkv
Up.2009.BRrip_-_(Film98-Net).mkv
How.To.Train.Your.Dragon.2010.720p.Bluray_-_(Film98-Net).mkv

[code]...

View 6 Replies View Related

Ubuntu Networking :: Can't Share Some Files

Mar 23, 2010

I've setup sharing on ubuntu to my windows 7 PC and it recognizes folders all folders i set to share except on my partitioned 2nd hard drive. I'm thinking its because its password protected, how do i remove this security? it shows the folder but i cannot access it

On my windows 7 it gives me: windows cannot access \usernamemovies check the spelling of the name. otherwise, there might be a problem with your network.

View 4 Replies View Related

Ubuntu Networking :: Share Files From Pc To Ps3?

Apr 11, 2010

I just installed mediatomb so i can share files from my pc to ps3 when i try to access my slave hdd's i get this error msgs "Error: could not list directory /media/Geimsla 2 : Permission denied"

View 6 Replies View Related

Ubuntu Networking :: Share Files Between Mac Win 7?

Jun 20, 2010

I have set up our home network with an E2000 Linksys router and we have a wireless printer on this Network 2 windows 7 pc's, 1linux (Ubuntu 10.04), 1 iMac (snow leopard), and 1 Windows Xp pc.

This might be an easy question or a tricky one but if anyone knows how to make it so that we can share files between computers and also so that they can all access the printer on the network.

So far the only ones that can see each other on the network are the Windows pc's but i am still having trouble even making it so that the Windows pc's can share files.

View 1 Replies View Related

Ubuntu :: Created A Little Bash Script For Renaming Files From A Folder?

Feb 28, 2010

I created a little bash script for renaming files from a folderEvery time i hv to put that bash script file (rename.sh) in folder Is there any ways i will call (rename.sh) from terminal without moving rename.sh into any folder ?ne More Question : Whenever i run any .sh file automatically one .sh~ file created it is my programing mistake or is it exists ?

View 7 Replies View Related

Ubuntu :: Renaming All Files In Directory But Leave The File Extension Alone?

May 22, 2010

how can I rename all files in a directory up to the first dot (there by leaving the file extension alone) to the same thing? Im trying to rename all my media files and associated files in a directory to (preferably) the name of the directory it self. if I have

Code:

A Clockwork Orange -
wzzyfg.cd1.avi
wzzyfg.cd2.avi
wzzyfg.nfo
ACO.fanart.jpg
orange.tbn

Id like to automatically mass rename them all to

Code:

A Clockwork Orange
A Clockwork Orange.cd1.avi
A Clockwork Orange.cd2.avi
A Clockwork Orange.nfo
A Clockwork Orange.fanart.jpg
A Clockwork Orange.tbn

I have rename on my server which I used to remove underscores from file names, but I dont know how I would use it to rename everything up to the first period. Bonus points for renaming stuff to the name of the parent folder!

View 5 Replies View Related

Ubuntu :: Renaming Video Files Based On The Date Created

Aug 4, 2011

I have hundreds of MTS and AVI files since 2000 and would like to rename them in the following manner based on the date created: DD-MMM-YYYY HH.MM.SS_X; where X begins at 1 and increments by 1 if there are dublicate date/time stamped videos.

Ex: 19-Nov-2002 08.12.30.avi, 19-Nov-2002 08:13:30_1 and 19-Nov-2002 08:13:30_2

Someone previously wrote the following script for me, and it works great for photos. It uses EXIV2 to get the image date created info. I have tried to understand the script, but am struggling. The video files I have can use the date modified since I have not modified them since I filmed them.

#!/usr/bin/env python
import os
import stat
import pyexiv2
import time
directory = '/home/david/Desktop/test'
[Code].....

View 1 Replies View Related

General :: Batch Renaming Of Files In A Directory Using Sed

Dec 11, 2010

I run a script which generated about 10k files in a directory. I just discovered that there is a bug in the script which causes some filenames to have a carriage return (presumably a '' character).

I want to run a sed command to remove the carriage return from the filenames.

Anyone knows which params to pass to sed to clean up the filenames in the manner described?

I am running on Linux (Ubuntu)

The character causing the filename to 'break up' accross multiple lines appear to be a CR (carriage return) instead of ' '. The filename is being diaplayed in thetitle of a text editor with %0D in the positions of where the file name breaks up. So I need to remove the CR chars from my filenames.

View 1 Replies View Related

Programming :: Bash - Renaming Files Won't Work

Apr 1, 2010

I'm trying to rename a lot of files getting rid of the space on the names. For that purpose I wrote this very simple bash script, but for some reason is not working.

Code:
for i in "$(ls)"
do
j=$(echo "$i" | sed 's/ /_/g')
mv "$i" "$j"

done But what I get in return for each line is just one long file name with all the file names concatenated. I've tried with echo -e "$i" as well with no results. This has to be something really simple that I'm missing but I just can't see it.

View 11 Replies View Related

Programming :: Renaming Files With Asian Characters?

Jul 19, 2010

I have a bunch of files that I need to rename, ordinarily this is pretty easy task. The problem here is that the file names have Chinese / Japanese characters. ie [$$$$$$$$].SOMETHING BLAH BLAH.ext Where all the "$$$$" are insert Chinese characters. The problem is that sed or perl doesn't seem to handle the Chinese characters correctly so using a regular expression like this 's/^[*.]//' which would normally work doesn't. From what I have read so far I believe these characters are double encoded UTF-8 (not 100% sure) which could be the problem. So far I've tried numerous different regex's as well as playing around with convmv to see if I could convert the filenames to just single encoded characters but I've had no luck.

View 1 Replies View Related

Ubuntu Networking :: Unable To Share Files?

May 17, 2010

I cannot, in any way, share files between my Windows 7 and Ubuntu PCs. I have tried everything out there and nothing seems to work. I don't get why! I have samba installed, I have installed the apache2.2 packages and I have checked the network file sharing.

I can create shares with folders and I can see all the windows computers on the network (but can't access any of them).

I cannot view my Ubuntu computer from the Windows computer either.

View 4 Replies View Related

Ubuntu Networking :: Getting Windows 7, XP - To Share Files

Sep 22, 2010

Recently, I've again been trying to get file sharing working on my home network. I made some progress last night, getting so far as having all the shares on my Windows XP desktop visible to a netbook running Ubuntu 10.04 & connected wirelessly. But I ran into some snags.

Here's what I'm working with:

-a desktop running Windows 7 Ultimate
-a desktop which dual boots Ubuntu 9.10 64-bit and Windows XP Pro SP3
-a netbook which dual boots Ubuntu Netbook Remix 9.10 and Ubuntu 10.04.

Everything connects wired except the netbook, which connects wirelessly. The router assigns each a specific internal IP address, so in effect all have static internal IP addresses, tied to the MAC addresses of their network adapters.

I have Samba Server Configuration Tool installed on both the desktop (Ubuntu 9.10) and netbook (Ubuntu 10.04). Versions are 1.2.63 in both Ubuntu 9.10 and 10.04.

Here's as far as I got last night:

-Shares on the Windows XP machine were accessible from both the Windows 7 machine and Ubuntu 10.04 on the netbook, with no password required.

-I configured Samba on both machines to be part of the same workgroup (named PENGUIN) as the Windows 7 machine and the desktop when it's running Windows XP.

-I set up a share in Samba on the netbook while running Ubuntu 10.04. The share is visible on the network from the Windows 7 machine, but I couldn't access it. I was asked for a username and login. I had no idea which one to use, but no combination I tried worked. Windows kept saying it couldn't find a "path" to the share.

-In the Nautilus "network" item on the netbook, I can see the shares on my Ubuntu 9.10 desktop. But I can't access them. Again, I get asked for a username and password, and I have no idea what to enter, or where the username and password can be set.

-I set up a share on the Windows 7 machine, allowing read-only access to everyone. But it doesn't show up on either of the Ubuntu machines, at all, in the "Penguin" workgroup. So I'm not sure how to proceed.

Do I need to explicitly configure the IPv4 settings on each machine to a static internal IP? As I stated, each machine gets a predictable address assigned by the router, so in effect the machines do have static IP addresses. However, I'm not sure that's all the same to Samba.

View 6 Replies View Related

Ubuntu Networking :: Share Files / Folders Using CLI?

Oct 8, 2010

I want to share certain files/folders with other computers in the network. Now I know how to do this in two ways: using the GUI and modifying the smb.conf file, but the GUI may not be available (e.g. connecting to the server using SSH) and the smb.conf file takes a little bit of time to modify (and from what I have noticed by using the GUI, the smf.conf file does not get modified). Is there a way to share files/folders using only the CLI and without the need of modifying files?

View 5 Replies View Related

Ubuntu Networking :: Have Been Trying To Use NFS To Share Files With No Result

Oct 15, 2010

Have been using Ubuntu for 18 months now - its great.Just added a second PC - both hard wired to a wireless router.Have been trying to use NFS to share files with no result.I want to share all files in "home" on PC called "Dimension".

View 4 Replies View Related

Ubuntu Networking :: Unable To Share Files With Others?

Sep 1, 2011

I live in an apartment that is shared with others. We all connect to the internet through the same router. I have files I would like to share with others but have been unable to figure out how to make folders public, or how to view public folders of others and get their files.

View 9 Replies View Related







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