252
votes
17answers
253k views

How do I detach a process from Terminal, entirely?

I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy.However, I'm struggling with how to completely detach a ...
327
votes
31answers
221k views

How to execute a command whenever a file changes?

I want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with ...
22
votes
3answers
13k views

Screen a running process

Sometimes I forget to run a program under a screen session and can't stop it in the middle, and I know it's going to take long. Is there a way to screen an already running process without restarting ...
24
votes
3answers
34k views

How do I fork a process that doesn't die when shell exits?

If I run emacs from the shell:$ emacs foo &and then kill that shell, emacs dies.How can I run a command so that it will not die when the shell dies?I found references to nohup, but that ...
180
votes
15answers
129k views

How to reliably keep an SSH tunnel open?

I use an SSH tunnel from work to go around various idotic firewalls (it's ok with my boss :)). The problem is, after a while the ssh connection usually hangs, and the tunnel is broken.If I could at ...
213
votes
11answers
131k views

Reload a Linux user's group assignments without logging out

When assigning a user's secondary group list using:# usermod -G <grouplist> <user>is it possible to force this group assignment to take effect without logging out all running sessions?...
119
votes
9answers
151k views

What to do when Ctrl + C can't kill a process?

Ctrl + C doesn't always work to kill the current process (for instance, if that process is busy in certain network operations). In that case, you just see "^C" by your cursor and can't do much else....
78
votes
4answers
129k views

How to make new file permission inherit from the parent directory?

I have a directory called data. Then I am running a script under the user id 'robot'. robot writes to the data directory and update files inside. The idea is data is open for both me and robot to ...
96
votes
3answers
66k views

scp between two remote hosts from my (third) pc

I have two remote hosts.host1-> 10.3.0.1host2-> 10.3.0.2Both run an ssh server.The ssh server listens on port 22 in host1 and on port 6969 in host2.Now, using my local machine, I need to copy ...
18
votes
3answers
9k views

How can I do Ctrl-Z and bg in one keypress to make process continue in background?

I follow this pattern of suspending the task and then letting it to continue too often with the Ctrl-Z bg sequence.I was wondering is there any way to compress that to single keypress?My shell is ...
13
votes
4answers
17k views

Can I use pipe output as a shell script argument?

Suppose I have a bash shell script called Myscript.sh that need one argument as input.But I want the content of the text file called text.txt to be that argument.I have tried this but it does not ...
5
votes
2answers
3k views

How can I alias a command for sudo?

I have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this:alias rm=trashThis works fine as a normal user, and it works fine when I use sudo -i ...
1505
votes
6answers
155k views

How do I make a machine “blank screen” for a period of time (as a penalty) if certain noise levels are reached?

My kids (4 and 5) yell a lot when playing games on the computer. I found an effective cure for this. When I hear loud noises, I ssh into the game computer and do:chvt 3; sleep 15; chvt 7 This ...
28
votes
6answers
81k views

why run a Linux shell command with &?

I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the ...
20
votes
1answer
6k views

Why do we have login, non-login, interactive, and non-interactive bash shells?

So the bash man pages explain what login and interactive shells are:A login shell is one whose first character of argument zero is a -, orone started with the --login option.An ...

153050per page