This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
useful_commands [2012/10/06 12:29] 85.218.109.130 created |
useful_commands [2012/10/06 17:39] (current) 85.218.109.130 [xterm: keep open] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | xterm -xrm '*hold: true' -e $1 & # this is to keep xterm from closing | + | ==== ls by last edited... ==== |
+ | |||
+ | * return the last edited file | ||
+ | |||
+ | <code bash>ls -ct1 | head -1</code> | ||
+ | |||
+ | broken into elements: | ||
+ | |||
+ | <code bash>ls -c #sorts by ctime, newest first | ||
+ | ls -clt #shows ctime and sorts by ctime | ||
+ | ls -cl #show ctime, sorts by name | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ==== xterm: keep open ==== | ||
+ | |||
+ | |||
+ | * run a command in xterm, keep xterm open even after the process finished or exited with an error | ||
+ | |||
+ | <code bash>xterm -xrm '*hold: true' -e $1 & # this is to keep xterm from closing | ||
pid1=$! # this is to save the pid, in case you want to close it | pid1=$! # this is to save the pid, in case you want to close it | ||
disown # this is to prevent the finishing shell from closing the xterm | disown # this is to prevent the finishing shell from closing the xterm | ||
+ | </code> | ||
+ | explained here: http://stackoverflow.com/questions/11668558/open-several-xterm-windows-from-script-without-closing |