2
votes
0answers
19 views

Running Custom commands in a Terminal Application [duplicate]

I'm running a terminal application in /dev/pts/X terminal that has its own console as:         What I need is to run commands specific to this application but from ...
7
votes
3answers
355 views

How to permanently change both STDOUT and STDERR color to grey?

This question is similar to Can I configure my shell to print STDERR and STDOUT in different colors? But I am looking for a solution that will allow me to change both STDOUT and STDERR to ONE color. ...
8
votes
2answers
326 views

disable CTRL-D window close in terminator (terminal emulator)

I am often logged in through multiple SSH sessions. To logout from my sessions, I press CTRL+d, until I am back on my local machine. However, sometimes I press once too many, and my terminal exits. ...
1
vote
2answers
34 views

How to get text at start up of terminal

How to get text at start up of terminal as shown in this image.It should show whenever i open terminal.
5
votes
2answers
162 views

if statement in .bashrc not working correctly

I set up .bashrc to show a long prompt if the terminal is at least 80 characters wide. Otherwise it shows a degraded, smaller prompt. I use an if statement to achieve this: dp_smaller_than=80 if [ ...
7
votes
4answers
685 views

I am using `&`: why isn't the process running in the background?

I know that I can append & to a command to run the process in the background. I'm SSH'ing into an Ubuntu 12.04 box and running a python program with $python program.py & -- but when I go to ...
1
vote
4answers
105 views

How to set the process won't be terminated when the terminal stops

[Edit] Make it simple. I invoked java xxx... on Machine A using putty to connect from Machine B. However I cannot reach Machine B. How can I connect Machine A from Machine C to set the running ...
26
votes
5answers
1k views

How does clear command work?

I was recently trying to learn more about how the shell works and was looking at how the clear command works. The executable is located in /usr/bin/clear and it seems to print out a bunch of blank ...
0
votes
0answers
20 views

Convert rgba color value to a Terminal supported color

Randomly I will take the following example: rgba(122, 143, 186, 0.54) How can I convert this color to the closest Terminal supported color?
2
votes
2answers
64 views

In OS X Darwin, why can I interfere with text input across user sessions using cat?

OS X Darwin: Disrupting Terminal Sessions Across User Identities How, in Brief: with cat < /dev/ttys_, in Terminal. My Question This OS X 10.9.2 Darwin behaviour seems odd to me, and I would ...
16
votes
3answers
507 views

What are the responsibilities of each Pseudo-Terminal (PTY) component (software, master side, slave side)?

I am trying to figure out how a tty works1 (the work-flow and responsibilities of each elements). I have read several interesting articles about it, but there are still some blurry areas. This is ...
2
votes
2answers
129 views

Command-line editing vim style [duplicate]

I recently discovered terminal's feature, you can set the keys emacs or vi style I prefer the second. so if you do set -o vi You can use k j l h keys to navigate on the command line. And you can ...
2
votes
4answers
128 views

Incrementing a variable each time the system boots up

The idea is to initialize a variable and set it to 0. Then create a script that executes on boot and increments that variable by 1 each time the system boots up again. Sounds simple enough right?
5
votes
3answers
480 views

How to merge two files with different number of rows in shell?

I have file1 like this: CHR SNP TEST A1 A2 GENO O(HET) E(HET) P 0 AFFX-SNP-000541 ALL 0 0 0/0/0 ...
0
votes
1answer
96 views

set tab color in a tabbed terminal emulator

I would like to set in my terminal emulator (i.e. gnome-terminal) the color of the tabs like in the osx's terminal emulator. Is there this feature in any of the linux terminal emulator plethora? ...
3
votes
5answers
413 views

What are the special characters to print from a script to move the cursor?

I found that by printing \r from a script the cursor moves to the beginning of the line. What character will move the cursor up one line? Where is a list of these special characters? EDIT: Working ...
10
votes
1answer
386 views

Clear old prompt lines in bash to save scroll space

My terminal theme used to be like this, But I thought the prompt wasted so much space. And later I got an idea that I could clean the prompt every time I ran a command. I was using bash, one of ...
1
vote
1answer
85 views

Autocompletion and coloring not working, when using ssh in emacs shell

I'm connecting to remote server using emacs shell. Emacs shell displays directory listings with proper coloring and auto completion when working with local machine. But when I use ssh the ...
6
votes
4answers
233 views

Prevent terminal from displaying previously executed command

I have a script that allows me to log random thoughts while working on a project. In the terminal I would add a new log entry by running $ @ "some random thought" where @ is just an alias for my ...
1
vote
1answer
43 views

Can I increase brightness of text in Arch shell?

I just installed Arch Linux. All I have right now is the shell. The text is very difficult to read on a black background. My eyesight is fine. Can I change the brightness of the text, or can I ...
1
vote
1answer
273 views

Echo/Printing text in the color of a given hex code (regardless of Xresources/Xdefaults)

is there any way to echo/print text in the color of a given hex code (#000000, #FFFFFF, etc.) regardless of one's own Xresources/Xdefaults color definitions? Like, if Bob had in his ...
1
vote
2answers
94 views

Using globbing/wildcards when Opening Files from Terminal

I have a folder A. Inside the folder, there are some files a,b,c,d and there is a subfolder, B, containing files e,f,g. Suppose I want to open files a,b,c,d: then I just type xdg-open *. However, ...
1
vote
1answer
104 views

How to change permissions from root user to all users?

I created a folder on the command line as the root user. Now I want to edit it and its contents in GUI mode. How do I change the permissions on it to allow me to do this?
0
votes
2answers
93 views

Using Pipeline to Direct Files to Program that Opens Them

I have a Music folder, in which I have some music tracks, which aren't organized too well. Thus, if I want to find a particular track, I usually type: ls Music | grep <keyword>, where ...
3
votes
1answer
391 views

Is there something like a lorem ipsum generator?

Is there something like a 'lorem ipsum generator'? I know it exists in Latex, and even in LibreOffice, but I'm looking for a terminal command. I would like to type something like loremipsum 10 ...
0
votes
4answers
172 views

How do I store long hostnames list for SSH quick usage?

I have an SSH access to a lot of servers. And all that hostnames (and sometimes usernames) are long and hard to remember. Also even if I tweak my Terminal to keep eternal bash history, the using of ...
2
votes
1answer
63 views

How to restore from a scrambled screen?

My screen is scrambled while reading some unexpected chars, It happens in a local tty, so logging out won't help. Any ideas? Hopefully I don't have to reboot
5
votes
1answer
272 views

A program that runs in a shell (e.g. pine) vs. a shell script

Having a bit of trouble finding the answer to my question, perhaps because I may be asking the wrong question. I understand bash scripts. I write them all the time to do little helpful things ...
0
votes
2answers
193 views

Commands pasted into terminal are truncated

I have a list of commands I would like to paste into the terminal so that they run one after the other. Initially they run fine, but commands later on are being truncated. Example command: ogr2ogr ...
3
votes
10answers
1k views

How do I run the same linux command in more than one tab/shell simultaneously?

Is there any tool/command in Linux that I can use to run a command in more than one tab simultaneously? I want to run the same command: ./myprog argument1 argument2 simultaneously in more than one ...
1
vote
1answer
618 views

The command ` ls -ltu ` fails to list folders/files based on last accessed time

First on your linux desktop create 2 folders. a b Now run this in the terminal ls -ltu the result is drwxr-xr-x 2 root root 4096 Aug 30 20:33 b drwxr-xr-x 2 root root 4096 Aug 30 20:33 a ...
4
votes
3answers
737 views

Get vertical cursor position

This might sound pretty weird, but I know how to set the vertical cursor position in Bash like this: echo -e "\e[12H" This moves the cursor to the 12th line (starting with 1). So how do I get the ...
4
votes
5answers
242 views

Only output most recent 10 (or n) lines of a lengthy command output

I have currently worked alot with shell and bash on linux. I have made tons of backups scripts and much more. In many cases I have a command that outputs thousands of lines. I actually need these ...
4
votes
1answer
216 views

Send stdin to console and compressed file

I'm running a propietary program which generates text output. Kind of like a logger. logger I'd like to both view this output on the terminal to watch the server breathe, and send it to a text ...
3
votes
4answers
185 views

Show video files with its size

I need all the .mp4 files' dimensions to be printed with the file name. For example: 1_VIDEO.mp4 1204x680
2
votes
1answer
337 views

cat >/path/to/file <<EOF drops some paste content, also patch <<EOF too. Why?

From time to time I like to use cat >/etc/configfile <<EOF thing, and paste content, then send EOF that will flush it into file. Its good with one or two lines, but when there's more of them, ...
1
vote
2answers
256 views

Getting specific line from terminal output

"Hmm, I need to edit file-i-must-edit-2, but I cannot remember where it is." locate file-i-must-edit /home/user/file-i-must-edit-1 /home/user/file-i-must-edit-2 /home/user/file-i-must-edit-3 ...
1
vote
2answers
207 views

Use a different shell by default in each terminal emulator

I would like to change the default shell in each terminal emulator separately. To clarify, I want Xterm to use TCSH, pterm to use pysh, gnome-terminal to use BASH, etc. Is this possible? If so, how ...
2
votes
1answer
528 views

Use the terminal's autocomplete path feature for input to a shell script

I want to make a script that: (1) Gets a path giving the user the ability to use tab to autocomplete, then (2) gets a filename from the user, and then (3) creates a file at that path with extension ...
0
votes
2answers
128 views

Why are there empty lines in the output of my command?: find ~/x/y/ | shuf > ~/Desktop/z.txt

As it turns out the reason for this problem was one filename with several newlines. (No idea how that happened.) find ~/x/y/ | shuf > ~/Desktop/z.txt This command works pretty much as expected ...
2
votes
2answers
1k views

What does the tilde (~) mean at the end of a filename? [duplicate]

What is the file with the ~ at the end of the filename for? $ ls # aliased to add flags -rwxrwxr-x 1 durrantm 2741 May 16 09:28 strip_out_rspec_prep_cmds.sh~* drwxrwxr-x 13 durrantm 4096 May 16 ...
2
votes
3answers
247 views

Log in with specific shell at terminal login

If I log in to a system over ssh, I can use the default shell with a simple ssh user@host, or specify something like ssh user@host 'bash --norc --noprofile' or ssh user@host ksh. Is it possible to ...
2
votes
0answers
99 views

zsh: Echoing every statement?

I have an odd problem with zsh when I switch between shells in a particular way: Option 1 (works well): I start a zsh shell. I switch to tcsh with /bin/tcsh, and I switch back to zsh with /bin/zsh ...
4
votes
4answers
753 views

Getting stdin from a named pipe

What I am trying to do is run python in a terminal window and redirect it's stdin from a named pipe. Then I write to the named pipe in another terminal and have that command execute on python. ...
5
votes
1answer
36 views

IO and other shell commands when a program is not started by a terminal

I have several launchers on my desktop for various programs, and there is a "run in a terminal" setting for those launchers. When I check that setting, the program runs from a terminal, and logs its ...
0
votes
2answers
1k views

Why screen is not splitting my GNOME terminal?

I am working in a remote Linux box using VNC.I have a single terminal with lots of tabs opened in my system. How can I split them using the screen utility? Does the screen utility work with already ...
2
votes
3answers
515 views

What's the difference between these ways of accessing the shell?

From what I know it seems that there are many ways to access the shell on Linux. So far the methods I know are: To use a program such as Terminal or Konsole To use the shortcuts CTRL + ALT + F1-6 To ...
15
votes
1answer
506 views

How does “man” restore the screen when I quit the program?

If I open a man page of a program like cat or ls, it prints (may not be the appropriate word) the contents of the man page and when I press q, it shows the screen just like before invoking the man ...
0
votes
1answer
915 views

What is the .screenrc file for?

What is the .screenrc file for? I have seen it in some dotfiles repos and such but I don't quite understand what it's for. Judging from the name it sets settings for the Terminal itself, not the ...
1
vote
3answers
818 views

How can I kill a job that was initiated in another shell (terminal window or tab)?

If I begin a process and background it in a terminal window (say ping google.com &), I can kill it using kill %1 (assuming it is job 1). However if I open another terminal window (or tab) the ...