A terminal is an environment for text input/output. Inside the terminal, one runs command-line and text mode programs (including shells).

learn more… | top users | synonyms

17
votes
3answers
1k views

How do I create a terminal-based gui?

I'm looking to create a terminal-based environment to adapt my bash script into. I want it to look like this:
142
votes
8answers
183k views

How to split the terminal into more than one “view”?

From vi, if you issue the command :sp, the screen splits into two "views", allowing you to edit more than one file from the same terminal. Along those same lines, is there a way to have multiple ...
1
vote
7answers
65 views

Rename files add dashes after fourth and sixth characters

I have some files such as: 20150716_something-here 20150716_something-heretoo 20150716_something-hereaswell They need to be renamed as 2015-07-16_something-here 2015-07-16_something-heretoo ...
1
vote
2answers
37 views

A quicker way to change owner/group recursively? [duplicate]

Currently, when I want to change owner/group recursively, I do this: find . -type f -exec chown <owner>.<group> {} \; find . -type d -exec chown <owner>.<group> {} \; But ...
0
votes
0answers
25 views

Can naming/running a program “sudo” somehow cause problems? [on hold]

I hope this is an appropriate place to post this--I have no idea what happened. I named a c++ file (a simple sudoku solver) "sudo.cpp" and then compiled it with "g++ sudo.cpp -o sudo" and ran ...
2
votes
2answers
146 views

How to use ESC sequences to make terminal region scrollable

I have a stm32f1 controlled device that uses USART/USB port to implement a user control interface. Using a standard terminal software (putty/minicom) a user has an ability to enter simple command in ...
5
votes
2answers
1k views

Can I set a bash timeout only for virtual consoles (ctrl+alt+{f1-f6})

I know that I can set a TMOUT variable to automatically end a bash session after a specified period of inactivity. However, what I want is to apply that only to my 6 built-in virtual consoles, which ...
0
votes
2answers
26 views

Tmux shortcut problem

While using Tmux, I tried to maximise the current pane using <prefix> z, and had a bit of a keyboard fail and accidently held down the prefix keys while pressing z, instead of letting go of the ...
0
votes
1answer
46 views

Hide and unhide cursor with tput

tput civis successfully hides the cursor. tput cvvis should unhide it, but it doesn't. Any idea what the problem might be?
61
votes
5answers
195k views

How to append multiple lines to a file with bash

I am writing a bash script to look for a file if it doesn't exist then create it and append this to it: Host localhost ForwardAgent yes So "line then new line 'tab' then text" I think its a ...
5
votes
1answer
87 views

Can a script determine which characters a terminal can display?

I'm working on a script that displays UTF-8 characters as output. In my Gnome Terminal, this prints out a pretty maple leaf (🍁): $ echo -e '\xF0\x9F\x8D\x81' In rxvt, it prints out a box (the ...
4
votes
2answers
317 views

How do I print the (numerical) ASCII values of each character in a file?

How can I print the numerical ASCII values of each character in a text file. Like cat, but showing the ASCII values only... (hex or decimal is fine). Example output for a file containing the word ...
12
votes
2answers
6k views

Ctrl+D for ending terminal line input

If I do $ cat > file.txt textCtrl-DCtrl-D Question 1: If I don't press enter, why do I have to press Ctrl-D twice? If I do $ cat > file.txt pa bam pshhhCtrl-Z [2]+ Stopped ...
0
votes
1answer
1k views

How enable ctrl + v paste in redhat? [duplicate]

I've installed Red Hat 6.5 and see that Ctrl + V does not work. It just prints ^V in the console instead of pasting from the clipboard. What can be wrong? How can I enable pasting using Ctrl + V?
3
votes
2answers
158 views

Ctrl-Backspace and Ctrl-Delete in bash

Putting on Debian 8.3 stty werase '^H' or on Arch Linux 2/2016 stty werase '^?' in .bashrc (for example) makes Ctrl-Backspace delete the last word in the terminal. Still it's not the same ...
0
votes
1answer
28 views

Return owner of process given PID

I'm trying to grab the owner of a process from a list, I have the command pidof nmap to get the then ps -u <PID> | grep USER that I'm currently playing around with, but when I run it, it ends ...
2
votes
1answer
883 views

Can't exit i3 because no sensible terminal emulator is installed

I am trying to setup Arch Linux, and after getting the most basic stuff setup I installed and ran i3 with: pacman -S i3 dmenu xorg xorg-xinit startx It finally started, but I can't exit it. After ...
0
votes
2answers
24 views

Insert/overwrite mode in fish

I'm using Linux Mint on a MacBook and on its keyboard the equivalent for the INSERT key is the combination Fn + RETURN. At the moment I can only see the intended behavior of this combination in ...
1
vote
2answers
3k views

open gnome terminal with several tabs and execute a few commands in every tab

This is what I want to accomplish: I want to open a gnome terminal with five tabs in it I want to run a set of commands (5 – 10 commands) in each tab automatically First tab: shall set clear-case ...
5
votes
2answers
97 views

How can I use the output of a command without using the mouse?

Imagine you issued a find command and now you want to use one line of the resulting output as an argument. $ find .. fileA fileB $ vi <CURSOR> # now do what to achive: $ vi fileB ...
1
vote
2answers
27 views

automatically disown application when running it from a terminal

How do you automatically disown an application after you have started it from a terminal? For example: if you start a terminal and run firefox the application will start, but when you then close the ...
14
votes
4answers
123k views

How do I exit or cancel a bad bash command?

I expect to get some flak for this, but I can't find the answer anywhere. It seems like it should be so obvious. Sometimes, when I type a bad command in a bash terminal, the cursor just jumps down to ...
1
vote
1answer
38 views

Set number of rows for gnome-terminal or other emulators

I'm aware there exists stty, which allows to set number of rows in a virtual console, such as tty1. However, this does not seem to work with gnome-terminal or xterm. The question therefore is, how ...
2
votes
3answers
127 views

Why does FreeBSD require terminal programs to be started as root?

On FreeBSD all graphical terminal programs (e.g. xterm, rxvt) seem to be installed setuid root, or with setuid root wrappers. On Linux, this is not the case on any distribution I have ever used. Why ...
1
vote
3answers
253 views

Terminator interface inside tilda emulator?

Does anyone knows how to use Terminator inside Tilda? I use Tilda emulator a lot but sometimes I need to have different terminal windows open to check things out and I don't want to open Terminator ...
1
vote
1answer
37 views

xkill Used On Desktop

Mouse accidentally clicked on Desktop while active with an xkill terminal command. Which makes it completely without use. Have used nemo command which resets everything as long as terminal remains ...
0
votes
1answer
24 views

how to echo/print block by block

I just started using tmux and butterfly and I need to scroll one panel. I tried Ctrl + b + ↑ but it scrolled the whole terminal instead of one panel. Is there any command line to display my ...
1
vote
1answer
17 views

Understanding what is happening when I dump a terminal character sequence with Ctrl-v?

If I want to bind a key-mapping to a function or widget in zsh I have learnt that I first have to hit Ctrl+v - at a prompt, then enter the key sequence I want to use, then use the output in my ...
1
vote
1answer
257 views

Use PSF font in X11 terminal emulator

I want to use a specific console font (/usr/share/consolefonts/Uni3-Fixed16.psf.gz) in a X11 terminal emulator (for example Terminator or gnome-terminal). I've stumbled over similar questions, but ...
11
votes
3answers
1k views

Escape sequences in output of script called from ncurses application

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl ...
1
vote
1answer
47 views

stty on old AT&T unix: how to add End-key for “end of line”?

How I can use the ctrl+e keyboard combination in emacs mode to go to the end of the line, but also be able to use the End key to do the same? How do I set that with stty? I have tried this combination ...
0
votes
1answer
323 views

What are these strange characters in wifi-menu and alsamixer?

I have a fresh install of Arch. When I run wifi-menu or alsamixer, both of which I think use dialog, the display in the shell is not correct. The border, for example, is drawn with the wrong ...
14
votes
2answers
788 views

Colored output?

When I execute a command from a terminal that prints coloured output (such as ls or gcc), the coloured output is printed. From my understanding, the process is actually outputting ANSI escape codes, ...
0
votes
0answers
56 views

Ubuntu login loop, amongst other issues!

Before I explain the issue, please bear in mind that I am a complete newbie to using Ubuntu on a desktop. I have some Ubuntu Server experience and know the basics of terminal/CLI. Seems like this is ...
63
votes
7answers
4k views

How safe is it to cat an arbitrary file?

Sometimes when I cat a binary file by mistake, my terminal gets garbled up. Nothing a quick reset can't fix, but couldn't an attacker theoretically create a file that, when displayed on a terminal, ...
0
votes
2answers
25 views

How to get the opened pty for a given background process (without login) in AIX

Using this answer http://unix.stackexchange.com/a/283521/114939 which allow us to find processes that keep an given pty opened without login (who command cannot show them), caused me to ask the ...
7
votes
2answers
3k views

working with filenames in a different encoding over ssh

I'm ssh'ing to a remote system where a different encoding for the filenames (and for the users' locales) has been used. And this causes some problems. Problems solved by matching the locale settings ...
3
votes
2answers
166 views

Broadcast messages don't appear on gnome-terminal, but appear on xterm

I'm curious about the behavior of broadcast messages by $ sudo wall myfile the message from myfile appears on all /dev/ttyN devices (the ones to which I can switch by pressing Ctrl+Alt+fN), it also ...
2
votes
1answer
37 views

Why are some pts in AIX never reused?

In an AIX system (AIX p740 1 7) that is running for about several months, some pts aren't reused anymore. This was noticed using the "who" command, with the following "awk" expression, running it ...
0
votes
1answer
17 views

Stopping infinit loop from php script run in linux terminal

I am currently following a tutorial that teaches how to create a queue in php. An infinite loop was created in a php script. I simplified the code in order to focus on the question at hand: while(1) ...
4
votes
2answers
29 views

Question about behavior of control key shortcuts

I am confused about how Ctrl-key combinations work in terminal. In bash man page, there are various combinations such as: C-e - go to end of the line C-f - go one character forward etc. But then ...
0
votes
4answers
63 views

Writing output to file, similar to “script” command?

Is there anything that's similar to "script" but does not require the terminal to be open? I want to save the results from my program into a file, however I have some issues. I need to work ...
7
votes
8answers
573 views

Terminal: remember working directory [duplicate]

I have git repos stored in different directories which have long paths /opt/too/long/path/to/type/every/time/git-repo and it's kind of difficult to remember plus to cd to the directory every time is a ...
1
vote
1answer
31 views

How to install MIT Photonic Bands software package on Debian [closed]

How do I install the MIT Photonic Bands software package using Debian?
5
votes
3answers
1k views

How are terminal length and width forwarded over SSH and telnet?

When I view the length and width of my terminal emulator with stty size then it is 271 characters long and 71 lines tall. When I log into another server over SSH and execute stty size, then it is also ...
1
vote
2answers
38 views

How do I get my arrow keys working in the at> prompt

Whenever I try to use the arrow keys in the at> prompt (after, for example, running at now) it just shows control codes, eg. ^[[D for ←. This makes pasting and editing long commands difficult ...
3
votes
2answers
37 views

Mark descriptor as terminal for the -t test

One can test if a descriptor is connected to terminal with -t test. if [ ! -t 0 ]; then echo "Stdin is not from terminal" fi Having a descriptor X, pointing to a file or to a process (with ...
1
vote
4answers
57 views

How to force `screen` to clear the terminal after commands like `htop`

I have recently started using screen in order to be able to split my terminal vertically and horizontally. However, it does not clear the terminal automatically. For example, when I open a file using ...
1
vote
0answers
17 views

MOZREPL output showing up in terminal window

I have a very a annoying problem. I've using Mac Terminal over SSH to write Perl script with vim on a local virtual Debian machine. The Perl script uses the WWW::Mechanize::Firefox module which in ...
0
votes
2answers
30 views

centos7 terminal can't have image as background?

I previously used ubuntu, I can set a image as my terminal background. Yet, in centos 7, I don't see a place for setting image as the terminal background. What can I do to achieve this? It's ...