terminal

How can I delete all files in my folder, except Music -subfolder?

Duplicate Unable to remove everything else in a folder except FileA I guess that it is slightly similar to this: delete [^Music] However, it does not work. ...

How to import file into sqlite?

On a Mac, I have a txt file with two columns, one being an autoincrement in an sqlite table: , "mytext1" , "mytext2" , "mytext3" When I try to import this file, I get a datatype mismatch error: .separator "," .import mytextfile.txt mytable How should the txt file be structured so that it uses the autoincrement? Also, how do I ente...

Smart indenting in vim (normally great) is a disaster when pasting in a chunk of code.

I guess other editors are smart enough to turn that stuff off for pasting but when using vim in a terminal it can't distinguish between pasting and actual typing. What kinds of solutions or workarounds do you have for this? Added: there's also a setting that makes comments automatically continue on the next line. The indenting at leas...

Help me make my windows cmd.exe console work more like a Linux terminal

The windows terminal (the user-interface around text-applications like cmd.exe) really sucks. There is so much that the Unix-style terminals do that the windows terminal apparently cannot do, for example what if you want to re-size the window in both dimensions by dragging the border. The Windows terminal only allows you to change it's ...

OS X Terminal: Meta key + alt functionality at the same time

Is there a way to use "alt/option" key as a meta key but still be able to use the key to make some characters which need it? For example in my local keyboard layout: @ is alt-2 \ is alt-shift-7 | is alt-7 etc. So if I set alt as meta key, I can't make those characters. On the other hand using "press esc, release esc, press a key" to...

Binary data over serial terminal

My only way of communication with my embedded device is a serial port. By default, embedded Linux uses this port as a terminal. How do I disable this terminal and use the serial link to transfer binary data? I heard of commands like rx and tx but i cannot find them. I think I can just read() from and write() stuff to /dev/tty but I want...

Printing styled text to the terminal

I have a program that I run through the command line and I wanted to print out bold or styled text similar to how the man pages are bold (I can't think of a styled example offhand). How do I style text sent to the terminal? If it makes a difference, I'm running a MacOSX terminal. ...

How can I tell if STDIN is connected to a terminal in Perl?

How can I tell if STDIN is connected to a terminal in Perl? ...

How can I AppleScript Terminal.app to copy the current text on the screen?

I see in the AppleScript dictionary that the current screen's worth of text and the history buffer are available as properties. How would I AppleScript that to copy the contents of the currently selected Terminal.app tab to the paste buffer? Could I do it on the command line? What about the whole history log? ...

keyboard shortcuts broken for a remote Xwindows program

There is a remote machine, on which I login with ssh. On that machine, we have a Xwindows GUI program, namely nedit. All the keyboards shortcuts like CTRL-O or ALT-F for that program are broken (whereas other programs work just fine). Now the weird thing is that for another user these shurtcuts work! He has the same shell (bash) and th...

Only Questionmarks in Linux dirlisting

Hi, i'm doing a dir listing in my .ssh home dir which gives me a strange result: ls -lsa .ssh/ total 0 ? ?--------- ? ? ? ? ? . · ? ?--------- ? ? ? ? ? .. · ? ?--------- ? ? ? ? ? authorized_keys · The weird thing is, that this only happens for one user and only in this specific directory. If I do ...

Change background of Terminal.app from the commandline

Is it possible to change the background color of Terminal.app from the shell? If so, how? ...

How to get console window width in python

Is there a way in python to programmatically determine the width of the console? I mean the number of characters that fits in one line without wrapping, not the pixel width of the window. Edit Looking for a solution that works on Linux ...

Mac OS X Emacs Does Not Highlight Comments Correctly

Hi Guys, I'm pretty old school sometimes and I like working with Emacs in my terminal. (I work with IDEs all the time. But sometimes, when in the privacy of my own home, I just like a text editor a terminal and a beer) However, the default Emacs that comes with OS X does not seem to highlight the comments in font-lock-mode. I've seen ...

Setting non-canonical mode on stdin with Ruby

I'm playing around with making a simple terminal-based game with Ruby, and I'm currently trying to come up with a way of reading input from the terminal. So far I've been using gets, but I'd like to have the game react instantly without requiring a newline (so you don't need to press a key, THEN enter). I've figured out I need to put t...

How do you run a command in iTerm when it launches?

I'm working on configuring the iTerm terminal emulator for the Mac to do what I want. Apparently everything is done through what they call "bookmarks." OK, fine. I'm trying to create a bookmark that will open a tab, cd to a certain Rails project, and run the command script/server. What's supposed to happen is that this will launch the se...

Moving a folder from Desktop to the server?

I have a folder in my Desktop. I want to copy it to my server in Terminal. I tried this unsuccessfully [~/bin]# cp -r /Users/Sam/Desktop/tig-0.14.1 ~/bin/ cp: cannot stat `/Users/Sam/Desktop/tig-0.14.1': No such file or directory [edit] I run the command in my server. The problem seems to be in the fact that "/Users/Sam/Desktop/tig-...

Another shell open when at server?

How can I have another Terminal open when I am at my server by ssh? I do not want to type my password twice to get another terminal for my server. Perhaps, Bash has buffers similarly as Vim. ...

How to open a command terminal in Linux?

Hi, I want to open the terminal (command prompt) on a Linux machine using Java code. I know how to open command prompt in windows.The following code i have used in windows String command= "cmd c/start cmd.exe" Runtime rt = Runtime.getRuntime(); Process pr = rt.exec(command); I need the same thing in Linux. Thanks for your answers. I ...

Can terminals detect <Shift-Enter> or <Control-Enter>?

Is it possible for the terminal to detect < Shift-Enter > or < Control-Enter > keypresses? I am trying to configure vim to do key mappings that use these sequences, and while they work fine in gvim, they don't seem to work in any terminal console. The curious thing is that although < C-Enter > is not detected in vim, mapping < Enter > ...