Software :: Variables In Moving / Renaming Files - CURL Downloads
Aug 29, 2010
curl -L http://URL/file[1-2].txt -o $(date +%m-%d-%y) newfilename{1,2}.txt
Basically, this command goes to URL, downloads file1.txt and file2.txt, however it saves BOTH files as newfilename1.txt. I would like the script to name the second download (file2.txt) newfilename2.txt. So, before you say to use the -O switch in Curl, please understand that I wish to rename the files so that they are not what they were on the server (names are too long). So file1.txt becomes newfilename1.txt, file2.txt becomes newfilename2.txt. Is this possible? The command I listed works only until the newfilename{1,2}.txt, it always saves as newfilename1.txt
View 3 Replies
ADVERTISEMENT
Jul 12, 2010
using variables in CURL.Here's my code:
transfer_to_pcid="AAAAAAAA"
transfer_from_pcid="BBBBBBBB"
basic_password=`ssh rsync@some_test_domain 'curl --silent
[code]....
View 2 Replies
View Related
Mar 14, 2011
I am trying to rename a list of variables in my script using a second list of variables. I want the variables in the second list to replace the variables in the first list such that the first variable in List 1 is renamed after the first variable in List 2, the second variable in List 1 is renamed after the second variable in List 2, the third variable in List 1 is renamed after the third variable in List 2, and so on.
For example:
I know how to rename each file individually, but would like to run Do Loop which can rename all my output files at once.
View 7 Replies
View Related
Jul 2, 2010
I have a large collection of pictures, that are arranged in lots of directories such as pictures/june/001.jpg, pictures/july/005.jpg.I was wondering if it would be possible to move these pictures around so that they are also renamed to their parent folders name, such as moving picture/june/001.jpg to picture/june_001.jpg
Is there an easy way to do this or will i just have to write a shell script?
View 1 Replies
View Related
Jan 31, 2011
I would like to permanently move the special folders "Desktop", "Pictures" and "Downloads" into the "Documents" folder. Currently they are stored in their default location in my home directory. Can I just drag them there and my system will still work like normal, or do I have to do this with gconf or something like that? I'm running Ubuntu with stock Gnome desktop.
View 9 Replies
View Related
Mar 4, 2010
I have limited experience in terminal, but let me first explain what I am trying to do to see if there is some easier way to do it. Basically I want to change the skin in aMSN. I downloaded the new skin but am unable to unzip or move it without /root permissions. I don't know how to acquire this without being in terminal. So I figured there had to be some way to go into the terminal and use it to move the unzipped folder from the desktop to the aMSN skins folder.
View 3 Replies
View Related
Jun 24, 2010
Is there any curl API to configure only the required protocol. If I have proper openssl installed, the installed curl will have all the protocols (like HTTP, HTTPS, FTP, File etc...) supported by default. Is there any way to allow or disallow only some of the protocol at the runtime. Say I need to support only HTTPS, FILE and I dont want to allow HTTP. Is there any way to do this?
View 1 Replies
View Related
Jun 22, 2010
I know I have done this in the past but I apparently have some slightly off syntax. I need to download a list of files via cURL. The list of files changes dynamically and I have a server side script that runs and creates a manifest. I grab the manifest and then download the files from that. The files are formatted correctly in the manifest as I have done before but the issue is that when I grab files, only the first one is saved and the rest are written stdout. curl -O -K filemanifest.txt
Formatting of filemanifest.txt is as follows:
[URL]
[URL]
I know the filemanifest.txt format is correct as this is the same format as I have used previously without issues, I must just be calling it wrong somehow.
View 1 Replies
View Related
Nov 6, 2010
I am using curl as the following
Code:
curl "http://site.com/pages/{1,2,3,4,5}.html" > /home/myuser/allpages.html
i need to save each page in a separate page by the way i have tried this command
Code:
curl "http://site.com/pages/{1,2,3,4,5}.html" > /home/myuser/{1,2,3,4,5}.html
but it displays error
Code:
ambiguous redirect
is there any way to do that
View 5 Replies
View Related
Jun 10, 2011
I get a SD card. Put in the SD reader. It's empty. I go to my super-important-pictures-to-a-monthly-relatory folder and select all files. Select them for MOVE. Paste them on the SD card. When the move/paste process is finished, i click on the "Eject" button on top of the SD card name. Card's ejected. I can't access the card anymore. I take out the card and put on my other computer. From 300 pictures, there are only 10 available, the remaining ones are there, but with 0bytes and unrecoveable. I panic. I go back to my main computer, my pictures are not there anymore. The pictures were on the Home folder. I panic again. I reset the computer and boot on the LiveCD. I install foremost, scalpel, photorec and about everything till my USB drive complains about being filled up. I run everything and I can't recover my files. I'm in the danger of getting fired. Things like that makes Windows sounds more appealing. When you securely remove a pendrive, things get REALLY pasted there before screwing everything up with a removal.
View 8 Replies
View Related
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
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
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
May 6, 2011
I'm using cURL in ubuntu to download some files like
While some files may be missing from this sequence but when I just use curl -O [url]
cURL will download a 404 error page for those missing ones. How can I avoid this?
View 1 Replies
View Related
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
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
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
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
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
Jun 9, 2010
I'm trying to send files from a Unix server using http/curl to a Linux webserver running Apache. I get the following PUT error message when and the file does not send:
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for the URL
View 2 Replies
View Related
Sep 16, 2010
I have a TV/radio tuner and I installed the gkrellm-radio plugin. The plugin works fine, but, it only works with /dev/radio. I'm not sure if its safe to rename files so I just create a symlink of /dev/radio0 as /dev/radio.
It gets pretty annoying to me to have to create a symlink every time I start up my computer so I can listen to the radio. Is there a way to get linux to permanently name "/dev/radio0" as "/dev/radio"?
View 4 Replies
View Related
Apr 17, 2010
I often record music from the webradio with Streamtuner.How can I rename the mp3 files recorded in a way that numbers are added to the beginning of the filename representing the order in which the titles were played on the webradio station?I am looking for an automated solution like a renaming tool since there are usually hundreds of files in a directory. I used autorename / ARen for windows back in the day when I was still on XP. What I could do with the tool was:a) Sort the files by date of creationb) add an increasing number at the beginning of the filename based on the position in the sorted list.
View 3 Replies
View Related
Feb 12, 2011
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
View 3 Replies
View Related
Mar 6, 2011
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
View 4 Replies
View Related
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
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
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
View Related
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
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
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