Is it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing:
mkdir "new dir" and:
touch "new file.txt"
I want to rename files from:
imgp0882.jpg to something like:
20091231 1243 some topic.jpg
And how would it look in a shell script that uses parameters like:
for i in *.jpg do rename "$i" "$somepath/$mydate $mytime $mytopic$extension" ?
I'm new to Linux (using PCLinuxOS 2009.2), coming from Windows, and I've written myself a little shell script to download files from my camera and then automatically rename them according to a date-and-topic pattern. As you can guess by now, I'm stuck on the bit about renaming. If you want to see my script, here's a copy. I'm not using jhead for this renaming because that only works with JPEG files but I want a single solution for any media format including videos.
Iam reading a file using C-sh script after manipulating the variables I need to dump into a new file. This in working fine but I couldn't retain the multiple spaces and tabs in a same line. For readability I want to print it back as I read. Now script treating multiple tabs as onl tab or space.
I tried Suse five or six years ago and ran into an issue that was not comfortable to work with so I went back to windows. The problem was open spaces between words was not permitted with my music files. I have transferred all of my CDs and LPs to MP3 and have a tremendous number of them and the Suse of five years ago required I convert a title like Foggy Mountain Special.mp3 into something resembling Foggy_Mountain_Special.mp3
I don't care to convert literally a hundred thousand titles to fit the latter format. Does the current version of Suse allow the use of spaces between the words or is the 'no open space' convention still required?
I have a laptop that I am in through SSH. The laptop does not have an Xwindow system so I am using the program fbi to open an image on my laptop screen from my SSH connection:
fbi -T 8 picture.jpg #this opens the image on the laptops tty8 terminal
I've found that making a for loop does not work with files that contain a space in the name. Something to due with a bug that they call a "feature" that stops the first variable at the first whitespace.
Using a "while" loop is not exactly what i require either seeing as I want to be able to view each image in the directory on screen and tag it accordingly, before it jumps off to the next image, and I'm not sure how to add a pause to a while loop.
How do I make a Bash script and loop Variables handle files like "files that contain spaces.jpg"
On Windows, I can drop file on batch script file, then dropped file is accepted as script parameter and script is automatically executed. Trying the same in Nautilus it seems like not possible.Is there some other way of using this approach in Debian?I hope it's clear what I'm after - I don't want to write Nautilus scripts as workaround and want to avoid: - opening terminal - cd to bash script - type script name andmeter file then executeinstead I would like already mentioned, drop filename expected as parameter to bash script, and then script to execute automatically.
I have noticed that lately when I drag a file into another folder to replace a file of the same name, nautilus crashes. I need to restart nautilus to fix this. I can copy and paste to replace the file without a problem though.
I am trying to read a file character wise and trying to write the same character to another file. In this process, I unable to read and write white spaces successfully to the new file. The script reads the white spaces but while writing the white space is lost. The section of the code, is given below. Please advice how can i read and retain the white space while writing to a new file.
Code:
if [ -s f_test.txt ] && [ -f f_test.txt ]; then echo "File Exists !!" while read -n1 char; do
I often get files with many spaces as part of their names. I would like to automatically replace these spaces with underscores, but otherwise not change the file name. Is there a way to do this task with just the bash shell?
I'm hoping that someone can help me, I need to remove spaces (not replace with underscores) from several thousand files on a system with cygwin. Can I do this from the shell using rename or mv somehow?
trying to write my thesis in Lyx 1.6. It works fine on my windows laptop at home but Not on my work computer. The problem is, when i try to view it in pdflatex it comes with with: Lyx: file name error The directory path to the document cannot contain spaces
I got myself a .bashrc file off the net. I checked it beforehand, didn't detect anything bad about it. One thing that's odd about it, is that several spaces are added to the terminal command line.Screenshot:Those spaces are not put there by me. The file can be found here: [URL]..
I'm currently stuck at 6.13 GMP-5.0.0 of the LFS installation. After running make, I receive the following:
error while loading shared libraries: libbfd-2.20.so: cannot open shared object file: No such file or directory make[2]: *** [libmpn.la] Error 127 make[2]: Leaving directory `/sources/gmp-5.0.0/mpn'
i am having a problem concern zlib installation.i tried configure file successfully but make file displayed some errors.that usr/linux/limits.h not found.so i found that i have to install glibc-headers-devel...but there is no such a kind of package in ubuntu repository?/????/some people saying that libc6-devel is equal to them!
I have an 500GB Iomega external drive connected to my iMac and used for the Mac Time Machine back-ups. I want to put a small partition on there that I can use to back-up my Ubuntu files which are on my laptop. I thought that I would be able to just copy the entire Home file on Ubuntu to this drive be drag and drop but this does not work. I get a notice to inform me that I do not have permission to create file there. I can however move files in the other direction (from the external drive to Ubuntu on the laptop. I assume this is because the external drive was formatted for Mac and I hope the problem will be solved if I could format a part of the drive in ext4 to accommodate the linux files.
Initially I thought - use a for loop with ls in it:
Code:
However this causes lots of problems (folders have extensions, I have duplicate folders, the names with spaces create a folder for each element of the name).
The contents of the folder is basically movies (some with subtitles). Some of the names have things like (original) or CD1 CD2 in them.
I would like to make a backup file from my fedora 12, in case if I have any problem with it, I could restore all my programs and settings from OS, I used do this with northon ghost in windows, but now in linux I don't know for sure. Yesterday I made a backup, in the end it was 34gb of his size, I wanna backup only what is used, how I do this?
If I have a file in which data is written which leads to the increase of this file size Is it possible to make a constraint such that this file size mustn't exceed certain size let say 5 MB for instance
I am having fedora 10 running on 64 bit machine. I want to upgrade to fedora 12 using preupgrade. Now as per my knowledge it downloads all rpms from Internet, i not having that much huge bandwidth me, so that option is not feasible for me.
I am having fedora 12 iso file: Fedora-12-x86_64-DVD.iso
How can i configure preupgrade to use iso file rather then downloading all rpms and download only what is necessary.
In fedora, to use browse mode, you have to right click on a folder and choose browse. How can I make that the default option, like in Ubuntu if that rings a bell on what I am talking about. Every time I double click a folder I would like browse mode.
I try to play a simple movie in avi format. The codec is called AC-3. I tried several tutorials, now i stuck with a "local file conflict between packages" when i run the auto install with movie player. I try now VLC Player ... With VLC it works! Open from the Administrator panel - Add or Remove Software than search for VLC and tick the main stuff and install.
I was learning to write a make file, I could understand most part of it of course with few exception I dint understand what does the below commands make(red font). I would like to understand what those syntax represent rather than mugging up without knowing what it means.