Tag Info

Hot answers tagged

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.


9

The ~/SDRIVE directory is mounted as a fuse filesystem which means that the filesystem operations are handled by some userspace program, not by the kernel. Those errors are coming from the filesystem implementation, which could be anything at all and is probably some kind of site-custom software. This is one of those times where you're probably going to ...


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


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'


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


4

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


3

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

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


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.


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.


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


2

Unfortunately, you cannot open old tabs in the Gnome-Terminal. Because Firefox is a web browser when you open a previous tab like that it just goes to the history file and goes to the website as the last entry. It is reloaded from the ground up. The Gnome-Terminal does not activate/go to set pages, instead it is just an interface to the console so you ...


2

Replacing cat that was used from the terminal and with awk -F, -v MID="$machine_ID" -v MNR="$machine_number" '( $4 == MID ) && ( $5 == MNR ) && ( $7 == "status" ) {t=$10} END{print int(t/60)}' /home/ed/start_up_job/my_datum_file.csv worked. Understanding the code: awk -F defines the field seperator as , -v assigns a value to a program ...


1

A Terminal Tab once closed flushes out all the output that was available on the screen. Plus, there is nothing that keeps a tab on what output was shown to which tab under normal circumstances. That is why, there is no functionality to go back. Though Firefox allows to re-open the Closed tab, it first looks into Cache, otherwise it requests the Server ...


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


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

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


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


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


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


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.


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



Only top voted, non community-wiki answers of a minimum length are eligible