Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.
Hide

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for:

Hide

News

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Hide

Credits

Commands using nohup from sorted by
Terminal - Commands using nohup - 16 results
nohup bash example.sh 2>&1 | tee -i i-like-log-files.log &
nohup exemplo.sh &
nohup bash -c "while true; do ps -x | mail pascalv@mmmmail.com; sleep 3600; done" | mail pascalv@mmmmail.com &
2013-08-19 17:21:37
User: pascalv
Functions: bash mail nohup
1

Run "ps -x" (process status) in the background every hour (in this example).

The outputs of both "nohup" and "ps -x" are sent to the e-mail (instead of nohup.out and stdout and stderr).

If you like it, replace "ps -x" by the command of your choice, replace 3600 (1 hour) by the period of your choice.

You can run the command in the loop any time by killing the sleep process. For example

ps -x

2925 ? S 0:00.00 sh -c unzip E.zip >/dev/null 2>&1

11288 ? O 0:00.00 unzip E.zip

25428 ? I 0:00.00 sleep 3600

14346 pts/42- I 0:00.01 bash -c while true; do ps -x | mail pascalv; sleep 3600; done

643 pts/66 Ss 0:00.03 -bash

14124 pts/66 O+ 0:00.00 ps -x

kill 25428

You have mail in /mail/pascalv

nohup tail /var/log/murmur.log | perl -ne '/^<.>[0-9:. -]{24}(\d+ => )?(.*)/; $pid=`pgrep -u murmur murmurd | head`; chomp $pid; `logger -p info -t "murmurd[$pid]" \\"$2\\"`;' &
2013-05-25 01:12:52
User: MagisterQuis
Functions: info nohup perl tail
0

Sends log lines from murmur's (the mumble server's) logfile to syslog.

nohup matlab -nosplash -nodesktop -nodisplay -nojvm -logfile output.log -r "function(0)" >output &
nohup ./my-shell-script.sh &
2012-06-26 19:43:42
User: ankush108
Functions: nohup
Tags: nohup
0

After you execute a command (or shell script) in the background using

&, if you logout from the session, the command will get killed. To avoid

that, you should use nohup as shown below.

nohup cat /dev/ttyS0 | tee -a llamadas.db&
nohup df -k | sort -rn 12
nohup ping -i1 www.google.com &
nohup nautilus &
nohup gnome-open . 0</dev/null 1>/dev/null 2>/dev/null&
2010-03-22 07:19:37
User: drunkcoder
Functions: nohup
-1

this will open the current directory in nautilus detached from your terminal.

nohup VBoxHeadless -p 3052 -startvm ServidorProducao &
nohup /bin/sh myscript.sh 1>&2 &>/dev/null 1>&2 &>/dev/null&
2009-08-18 07:24:52
User: AskApache
Functions: nohup
7

This command runs your shell script in the background with no output of any kind, and it will remain running even after you logout.

[[ $(COLUMNS=200 ps faux | awk '/grep/ {next} /ssh -N -R 4444/ {i++} END {print i}') ]] || nohup ssh -N -R 4444:localhost:22 user@relay &
2009-03-31 09:39:59
User: j0rn
Functions: awk nohup ps ssh
Tags: ssh cronjob
4

I find it ugly & sexy at the same time isn't it ?

nohup <command> 2> /dev/null > /dev/null &
2009-03-09 16:54:04
User: AmadeusZull
Functions: nohup
2

I'm sure this can be piped into another way. Please share!

nohup <command> &
2009-02-19 14:45:04
User: gnawa
Functions: nohup
5

puts command in background and sends its output to nohup.out file

it will not die if you log out fromyour shell session ;-)