Tag Info

New answers tagged

0

You can hold the Shift key to use the normal mouse selection while xterm mouse-tracking is enabled. That works in all terminal emulators that I know (xterm, vte (like xfce-terminal) or rxvt-based ones). In vim specifically, mouse is normally not enabled by default in terminals. So there's probably a set mouse=a somewhere in you ~/.vimrc or your OS-supplied ...


3

You can do this with screen in detached mode. Put something like this in your startup script: screen -d -m /opt/matlab_2013b/bin/matlab It will create a detached screen session, which should allow the script to start. You can attach to the screen session as normal at any time. You can almost certainly achieve the same effect with tmux, but I haven't used ...


1

The POSIX spec really hedges its bets where the Controlling Terminal is concerned, and which it defines thus: Controlling Terminal The question of which of possibly several special files referring to the terminal is meant is not addressed in POSIX.1. The pathname /dev/tty is a synonym for the controlling terminal associated with a process. That's in ...


4

The "controlling terminal" aka. CTTY, is distincted from "the terminal a process is interacting with". Standard compliant way of getting the path of ctty is ctermid(3). While in freebsd an actual path is looked up[1], the implementation in glibc as of version 2.21 unconditionally returns "/dev/tty"[2]. ps(1) from the linux procps 3.2.8 package, read the ...


2

Before X Windows there were several attempts at 'inband' graphic protocols. 4014 mode in classic xterm is one. I've seen it do some real work about 25 years ago to do wire frame 3d drawings. A more powerful graphics protocol in early 1980's VT300+ terminals was the DEC REGIS graphics. This was a full raster graphics language with options for 'mouse like' ...


1

The ubiquitous xterm can have a Tektroniks 4014 mode compiled in. The 4014 was a "storage tube" terminal: you could send escape sequences to it, and it would draw lines and text on screen. Looks like Arch Linux includes a tek 4014 demo. A 4014 manual is still on line. This is mainly a historic curiosity, I don't imagine this is what you want, but it does ...


-1

it's define Linux copy range of folders:- $ shopt -s extglob # to enable extglob $ cp !(b*) new_dir/


1

You are missing -n switch of command. You have to type: unix2dos -n /path/to/filename_unix.txt /path/to/filename_dos.txt As you typed it I think unix2dos is looking for two files to convert. So now your filename_unix.txt should be converted to dos.


1

This happened to me when I did an update that changed the default SCREENDIR with several active sessions. Like you, I couldn't convince it to regenerate the fifo (there's probably a bug report worth filing somewhere in this), so what I ended up doing was using reptyr to transition everything relevant to a new session. It's tedious, but allowed me to ...


-4

If you want to see the console messages, you can put at the end of /etc/rc.local, sleep 60


0

Though all of the suggestions work well I've found my alternative is to use screen, a program that sets up a virtual terminal on your screen. You might consider starting it with screen -S and then a sessionname.Screen can be installed on virtually all linux and unix derivatives. Hitting control a and c will start a second session. This would allow you to ...


0

You can try vim with AnsiEsc.vim plugin to view ANSI colors through escape codes, then redirect standard output to vim -, activate :syntax on and convert the file to html by vim command: :TOhtml. The generated html file should have coloured output. To convert source code non-interactively into html, try the following command: vim -E -s -c "let ...


0

This error happens when vim is invoked and it's connected to the previous pipeline's output, instead of the terminal and it's receiving different unexpected input (like NULs). The same happens when you run: vim < /dev/null, so reset command in this case helps. This is explained well by grawity at superuser. On Unix/OSX you can use xargs with -o ...


0

The simplest way is to pass locate as shell substitution, like: vim $(locate filename123) You can also consider to use find instead of locate to pass file names to edit, in example: find . -name 'filename123' -exec vim {} + On Unix/OSX you can use xargs with -o parameter, like: locate filename123 | xargs -o vim -o Reopen stdin as /dev/tty in the ...


0

After spending a descent amount of time looking around, I finally found two solutions starting with the best one mentioned first. I present them for the sake of completeness: One has to make sure to have the following line in the terminator configuration file: always_split_with_profile = True under the [global_config] section. The same issue was brought up ...


1

Apt action track sorted by time|date can be found in log-file /var/log/apt/history.log where noted all your action with packets wherever you install, remove or update. For example one operation tracked similar to: Start-Date: 2015-02-13 01:15:14 Commandline: apt-get install sylfilter Install: libsylfilter0:amd64 (0.8-2, automatic), ...


0

Most systems have a locate database which is updated every night. This does a find over the whole system and stores the result in an optimized database. In this case locate mysql-connector-java should have given an answer quicker than the find solution. Note that locate will only show files that are findable by every user, so files in protected directories ...


0

find / -mount -name '*mysql-connector-java*' -print the -mount predicate is so that find skips searching virtual filesystems like /proc and /sys (useless to search) and other things that might be mounted like network-mounted filesystems (which could make it really slow!), but you can omit it if you want to search absolutely everything.


1

So how does this affect the syntax required to add javac to the path? It doesn't affect your path settings. These links are configurable with the update-alternatives admin tool. See for instance this question on stackoverflow relevant to your case. Normally, the java binaries should be available without modifying the PATH variable for java binary ...


2

Typically X is started with the startx command or by starting the service associated with your display manager (mdm for you), which then starts an X server for you. You can probably fix this by running service mdm restart as root on one of your terminals.


0

When you run a class in Java, you need to give the full package name and class name, and be in the right place for that to match the folder and file name. So in your case, declare package cert; in your class as you did initially, build it, then run it as follows: cd ~/Desktop/OCA_Practice java cert.Test


2

No need to use a for-loop here, you can just use find: sudo find /var/log/ -type f -regex '.*\.[0-9]+\.gz$' -delete However, as suggested, check the manual page of logrotate for ways to reduce the number of files.


1

Well, first I guess I would point out that pretty much all terminals these days are "virtual" in the sense you talk about... even if the terminal is at the other end of a bona fide serial port. I mean, the days of VT-100s, Wyse terminals and other "physical", "real" terminals are pretty much gone! That aside, let's say you want to detect what kind of ...


0

They are quite distinct: A terminal provides a way to enter and display characters on a screen. The shell provides a way to have the operating system execute commands.


0

The shell is just a process that is controlled by the terminal, but this is also the case for most processes started by the shell itself. So, there is nothing special with the shell. For more information about terminals and shells in particular, you may be interested by: What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? ...


0

It seems you just want to change the user's password. In which case you can (as root) type: passwd user-name


10

Terminal parameters are stored as $LINES and $COLUMNS variables. Additionally you can use special term-operation programm, for example tput: tput lines # outputs the number of lines of the present terminal window. tput cols # outputs the number of columns of the present terminal window.


6

This command should give you the number of lines on the terminal: stty size | cut '-d ' -f1 Some systems might not implement stty size so you might need something like this instead: stty -a | tr \; \\012 | grep rows | tr -d ' rows'


1

If your terminal supports terminal addressing, save cursor and restore cursor, this might work: PS1="$(tput sc;tput cup 0 0;tput rev;tput el)\u@\h \W$( tput rc;tput sgr0)\$ " But beware that the command can be difficult to edit as the shell gets confused about where it is in the input buffer. In bash, you can tell it to ignore the cursor control ...


0

The tput command can be used to control the cursor, assuming you have your TERM variable set correctly. In combination with the LINES and COLUMNS variables, you can position the cursor wherever you want. The syntax is: tput cup line column For example: tput cup $((LINES-2)) $((COLUMNS-4));echo "[OK]"


3

Those are ANSI control sequences. There are no programs built-in that remove those codes, at least that I am aware of. A simple sed script, however, will the job for you: sed -r 's/\x1b_[^\x1b]*\x1b[\]//g; s/\x1B\[[^m]*m//g' Using the above with your sample input: $ echo $'\e[0;33m"2015-02-09 11:42:36 +0700 114.125.x.x access"\e[0m' | sed -r ...


0

A simple enough solution: Have process A exec a second process A first (call it A'). Then let A block forever. A' can start D, and D can restart A', and A sticks around the whole time as the parent.


1

I am using MC 4.8 and the following works for that version: create a ~/.config/mc/skins directory copy (or link) the .ini file defining the skin into ~/.config/mc/skins edit .config/mc/ini adding a line containing skin=solarized to the section Midnight-Commander.


0

Using the -p option instead of echo I found solved the hanging problem in a script. Tested with GNU bash, version 3.00.16(1)-release (x86_64-redhat-linux-gnu). IFS=';' read -sdR -p $'\E[6n' ROW COL;echo "${ROW#*[}" works interactively or in a script: #!/usr/bin/env bash function pos { local CURPOS read -sdR -p $'\E[6n' CURPOS ...


6

Once your terminate a job with CTRL+C it is terminated and you can't tell a dead job to continue and pick up where it was. The correct term is to run a job in the background, which you can do beforehand: ./script & You can use that in combination with nohup to make the process immune to hang-ups, it will continue to run even if you log out from ...


0

found this at Bash One-Liners  tr -dc a-z1-4 </dev/urandom | tr 1-2 ' \n' | awk 'length==0 || length>50' | tr 3-4 ' ' | sed 's/^ *//' | cat -s | sed 's/ / /g' |fmt must be limited by another command or generates text infintely


2

Short answer: you can't, at least not exactly the way you want. More useful answer: you can achieve what you want by piping the output to something like more or less , for example : locate linux | less This will pause the output scroll at the end of each page, where the page length is defined as the terminal height.


1

If using zsh, you can sort the list numerically with: printf '%s\n' *.txt(n) That's similar to GNU sort -v or GNU ls's -v sorting: ls -vd -- *.txt That sorts f2 before f10, but g1 after f2. To sort a list stored in a zsh array (as opposed to files in the current directory with globbing): files=( f1.txt f10.txt f2.txt ) printf '%s\n' ${(n)files} ...


2

GNU sort with -n option using strnumcmp() which does not do numeric conversions (See numcompare() function). This's purely string comparison. When your key field does not start with a number, the last resort sort sorts byte by byte, you will get the result alphabetic order base on your locale. Example: $ LC_ALL=en_US.utf8 sort -n test.txt f10.txt f1.txt ...


6

I recommend to use rather sort -V data.txt -V stands for "version sort" and it basically handles correctly both alphabetical and numerical characters, so that if you would have more files, say: f1.txt f10.txt f2.txt a1.txt a10.txt a2.txt then sort -V will give you a1.txt a2.txt a10.txt f1.txt f2.txt f10.txt whereas sort -k 1.2n or sort -n -k 1.2: ...


4

Because your data lines don't start with a number, the -numeric sort treats them as non-numbers (and so leaves them where they are). As soon as it stops being possible to interpret the data as a number -n stops caring. You need to use the -keyed sort option: sort -k 1.2n data.txt That sorts with a key defined by the first field, starting at the second ...


1

> sort -n -t . -k 1.2 file f1.txt f2.txt f10.txt Works even without the -t ..



Top 50 recent answers are included