General :: Using Tilde And Spaces

May 26, 2010

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.

View 5 Replies


ADVERTISEMENT

General :: Shell - Rename A File From Something Without Spaces To Something Containing Spaces?

Jan 26, 2010

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.

View 2 Replies View Related

General :: Editing, Vim Creates Another By The Same Name With A Tilde?

Jul 19, 2011

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.

View 4 Replies View Related

General :: File Names And Tilde--not For Home Directory--in Bash?

Jun 6, 2011

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?

View 2 Replies View Related

General :: Ubuntu And Apple Aluminium Keyboard: Remap Greater/less With Tilde

Feb 12, 2011

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?

View 1 Replies View Related

Ubuntu :: Cannot Use Mac Tilde Key (~)

Nov 27, 2010

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.

View 1 Replies View Related

Ubuntu :: What Is The Other Symbol On The Tilde Key?

Mar 3, 2010

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]...

View 2 Replies View Related

Ubuntu :: What Does ~ (tilde Symbol) Mean?

Mar 27, 2010

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?

View 9 Replies View Related

Ubuntu :: How To Reset Tilde Key

Jul 24, 2010

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.

View 4 Replies View Related

Ubuntu :: How To Write Tilde Symbol?

Feb 8, 2011

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.

View 3 Replies View Related

Ubuntu :: Disable Tilde Key Press-twice Feature

Aug 7, 2010

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.

View 9 Replies View Related

General :: How To Kill A Process With Name Having Spaces

Dec 10, 2010

A process with name=example can be killed by killall -9 example

How to kill multiple instances of following command which contain spaces?

"valgrind --tool=lackey ./testcases/kernel/syscalls/waitpid/waitpid03"

Following command returns valgrind --tool=lackey ./testcases/kernel/syscalls/waitpid/waitpid03: No such file or directory

View 3 Replies View Related

General :: Replace Multiple Spaces By One Tab

Feb 2, 2011

Ive some textfiles which contains some colums seperated by a various number of spaces, but instead i need one single tab as a seperator.

View 5 Replies View Related

General :: Replacing A Line With Spaces?

Jan 5, 2011

I have a line like

port = 2566

I want to replace it as

port = 8080

how to do this in shell script. when i tried to do this with sed

sed -i 's/port=.*/port='$3'/' /root/$2

it is not recognizing spaces , it works only if line is port=2566 .

View 6 Replies View Related

General :: Running SCP Command With Spaces?

Jan 21, 2010

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

Here's my string:
expect -c 'spawn scp -r /var/lib/asterisk/backups/Everyday/ administrator@192.1.1.1:
/Volumes/Data1/My Backup Folder/ ; expect assword ; send "MYPASSWORD " ; interact;'

View 4 Replies View Related

General :: Convert Tabs To Spaces In Many Files?

Jul 2, 2010

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?

View 2 Replies View Related

General :: Bash Command To Remove Spaces

Sep 14, 2010

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.

View 14 Replies View Related

General :: Getting Blank Spaces In Shell Script?

May 7, 2010

I did the following script:

Code:

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

View 4 Replies View Related

General :: Replaces Empty Spaces By Underscore?

Mar 11, 2011

my requirement is i need to copy mail subject to a text file and create one directory from the name of subject.

my MAIL subject is like this :

Quote:

Subject:Thanks to linuxquestions.org

i copied the mail subject to a file. and now the issue is to creating a directory.

now i want to create a directory without empty spaces, insted of space replace _ in that place.

i want out put like this.

Quote:

Thanks_to_linuxquestions.org

View 5 Replies View Related

General :: Spaces In Command Line Switches

Oct 6, 2010

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?

View 2 Replies View Related

General :: Ubuntu : Delete The Extra Spaces?

Jul 28, 2010

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?

View 13 Replies View Related

General :: Access Files With Spaces From Command Line?

Mar 17, 2011

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?

View 2 Replies View Related

General :: Remove Spaces From Many File Names Under Cygwin?

Nov 22, 2010

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?

View 4 Replies View Related

General :: Selectively Remove Blank Spaces From String?

Oct 7, 2009

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...

View 2 Replies View Related

General :: Bash - Rename Files With Spaces Using System Shell?

Jun 8, 2011

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?

View 5 Replies View Related

General :: Search A String Having Spaces / Slashes / Colons In Vi Editor

Feb 2, 2010

I need to seach a string containing

the substring of 'New Request object:'

and

the substring of '/0x2ab46b1f90' in vi editor,

how do I accomplish that?

View 7 Replies View Related

General :: Lyx: File Name Error The Directory Path To The Document Cannot Contain Spaces

Sep 9, 2009

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

View 1 Replies View Related

General :: Find List Of Table Spaces In Oracle In Unix?

May 11, 2011

command to find list of table spaces in oracle in unix

View 1 Replies View Related

General :: .bashrc File Adds A Couple Of Tens Of Spaces To The Prompt?

Sep 3, 2010

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]..

View 3 Replies View Related

General :: Bash Scripting - Sed - Lame - Character To Lame To Escape Spaces

Mar 20, 2010

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.

View 10 Replies View Related







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