I'm trying to use a tilde '~' for a filename. This works fine normally Code: rm ~/File
But when I have a file with a space in in and enclose it in quotes it takes it literally.If a word begins with an unquoted tilde character (�~�), all of the characters up to the first unquoted slash (or all characters, if there is no unquoted slash) are considered a tilde-prefix.
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.
Here's what is going on; I'll open any file in vim to edit, and then when I'm finished and I enter ":wq", instead of saving the file I was editing, vim creates another by the same name with a tilde.
I understand the tilde (~) at the end of a file displayed in bash is a backup file in the Linux file system. Is there a way to keep these hidden when listing the contents of a directory?
I have an Apple Aluminium keyboard. To the left of 1 key I have the less/greater (< >) key, not grave/tilde (` ~). xmodmap does not work for me: layout switching (done with setxkbmap) resets my xmodmap changes. .Xmodmap file does not help either. How do I remap the tilde key?
I have installed Ubuntu 10.10 meerkat on My Macbook 5,1 and all is ok so far.One thing I have noticed is I cannot type the tilde key how I normally do using SHIFT and then the button to the right of shift on my macbook keyboard. I have tried the UK and USA Macintosh keyboard option with no luck.As you can see my forum login uses the tilde key. I have to copy and paste the character. I cannot even see it in the character map.
I'm trying to remap my Nostromo N52 using pystromo, but can't figure out how assign the key with the ~ tilde on it. Everyone knows and refers to this key as the tilde key, but I can't for the life of me find the real name of it, since the primary symbol on it is not tilde but [URL]...
I'm absolute beginner to Linux for the most part. What does the tilde mean in this situation? Code: mkdir ~/.somedir...I know the / means root directory and the dot means from here. Does the tilde mean hidden?
So I've made a bit of a mess of things. I installed Tilda and had it working like a charm.I bound it to the tilde key (shares a key with ~, maybe it's called grave?) and it was great.I also have a Logitech MX Revolution mouse and decided to use xbindkeys to fix the thumb wheel which is the only set of actions that doesn't work out of the box. I decided to set the wheel press action to the tilde key, hoping to have a button on my mouse to open Tilda.
After fumbling around trying to figure out how to identify the tilde key I somehow managed to bind it to xterm. This wouldn't do. So in an effort to clear the binding to default I bound it to "". Well now the key does nothing unless I use it in conjunction with the shift key, in which case it produces the normal ~.So here's my question: how do I restore that key to it's default function? I should point out that I just started using Ubuntu 10.04 exclusively a day ago and have had limited experience on Linux before this.
i want to learn to use the terminalbut i am using a spanish keyboard and i don t know how to tipe the tilde � symbol.In windows i tiped boy de ALT + ascii code, but in ubuntu i don know how to do it.
I have noticed quite often that the tilde key only works when I press it twice. I've searched a while and found out that it can be used for accented characters like with the n (can't do that on Windows here anyway). I only know of the tilde-n from Spanish, I've never seen all of the other tilde-characters. And I do not need any of then ever. But I do need to type in my home directory (~) quite often and I want that to work the first time I press that key. Especially when it works through a PuTTY/SSH shell from Windows, but not directly in Gnome Terminal. The system preferences for the keyboard mapping don't help me out.
So how can I disable that double-press feature for the tilde key? It's allright for the accent keys, the � and ` accents alone are invalid characters and should never be used anyway (there's real quotation characters for that) (except for shell backtick expressions) and I don't need the ^ symbol (for coding only) often on Linux.Using Ubuntu 10.4 with German keyboard mapping (de), directly at the machine or via NX/VNC.
I am trying to run an scp command on my linux server, this is working fine, however I changed the output folder to one which has spaces and now when run, it's coming up saying SCP ambiguous target
I have a lot of files with tabs littered throughout, and I'd like to convert them all into spaces. I know about the expand command, but unfortunately I would have to type out every single file using it. Is there any easier way to do this on Linux?
I am reading the output of /proc/acpi/thermal_zone/ATF0/temperature in a program to read my CPU temp. I am using cat like the following:
Code: #cat /proc/acpi/thermal_zone/ATF0/temperature temperature: 49 C
I basically want to get rid of the spaces in between temperature and the actual temperature. Is there a command I can pipe the cat output to, to remove the spaces. I have seen suggestions for sed, or tr, but for some reason I cannot get them to work properly.
DIR=`pwd`;for i in `find . -name GESTION -type d`;do cd $i/..;setfacl -R -m g:directores:rwx, GESTION;echo $DIR'/'$i;cd $DIR;done
This code do the following actions:
1. Starting inside a folder, it's searching for any folder called "GESTION"
2. Every time a folder called "GESTION" is found, then the script move to its parent folder, and then it applies ACL permissions to the folder GESTION by using the command setfacl.
The problem is that the script doesn't works when there was found a folder with a blank space in its name. I mean:
/dir1/dir2/dir3/GESTION --> this works fine /dir1/dir2/dir 3/GESTION --> this doesn't works /dir1/dir2/dir3/2. GESTION --> this doesn't works
I am trying to encode files via mencoder. The file name has spaces in it. "test file.mkv". When I manually type the command in the terminal, everything works. But when I use a bash script (I'm reading it from a file) it doesn't. It gives me
Code: File not found: '"test' Below is the bash script I wrote
Code: #!/bin/bash # For testing, we have already built a file list, so just use that. # ls *.mkv>files.lst exec 10<files.lst let count=0 while read -u 10 FILE; do LINE="mencoder -of lavf -lavfopts format=mp4 -vf scale=1024:-3 -ovc x264 -x264encopts crf=28:vbv_maxrate=1500:nocabac:global_header:bframes=0 -oac faac -faacopts br=160:mpeg=4:object=2:raw -channels 2 -srate 48000 "$FILE" -o test.mp4" echo $LINE exec $LINE done
exec 10>&- files.lst contains only a single line (no newline) with Code: test file.mkv
On a related note, when I was first trying this simply on the command line, I had a file that had a double exclamation point. I found out that that is a shortcut of some kind for the previous command. My kludge to get around this was to try to execute a single exclamation point as a command, then to change the double exclamation point to a quadruple exclamation point. Is there a proper way (escape sequence or something) to pass double exclamation points to a command?
I want to ask a question regarding the terminal in ubuntu. When i deleted some lines in the config files for example, there will be those so-called extra spaces left after deleting and i can't seem to delete those spaces and 'pull' up the lines below. So, how to delete those extra spaces?
How do I access files with spaces from the command line? for example I want to go to a file called "New File" and let's say is in Downloads/Books/(and here is the file) how do I input the space since the command line doesn't recognize it?
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?
need all spaces between two letters or a letter and a number exchanged for an underscore, but all spaces between a letter and other characters need to remain. One example for clarity:
Input:
force -- lamin 90 [label] active A -- generation [label]
needed Output:
force -- lamin_90 [label] active_A -- generation [label]
I tried solving this with sed but obviously s/ /_/g does not work, nor does any s/[a-zA-z0-9] [a-zA-z0-9]/[a-zA-z0-9]_[a-zA-z0-9]/g , because you just can't do this...
I named a number of files with spaces in them, and I want to replace the space with "_". However, every time I write a command in the shell with the file name (eg "Spring 2011"), the shell doesn't recognize the file or directory. What can I do about this? Is there any way to use the unicode character for a space?
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]..
Ok, so I find myself ripping audio CDs frequently, which I then lame to mp3's to put on my media player. I usually define the --ta and --tl (artist and album) ID3 tags and batch encode each album, but don't bother with the track tags as I'd have to do each one seperately.
So, I'm working on a script to do all this for me, extracting info from 'pwd' etc. to fill in the blanks for --ta, --tl and --tt (track name). All is working well, except that I can't get sed to pass on the "" character to lame to escape spaces.
Here's what I've got so far: (trouble spot is bolded - no need to pay attention to the rest of it)
Code:
All this does is pass a 'space' on to lame, which it takes as an invalid argument.