This is useful for finding and killing a process. ps -A | grep some text in program name upon getting the pid kill -9 pid
killall programname
31–40 of 216 posts
This is useful for finding and killing a process. ps -A | grep some text in program name upon getting the pid kill -9 pid
killall programname
100% agree with CTRL-R. It changed my life. Others that I love: screen, pdsh, perl -pi -e 's/find/replace/g' *.txt redis-cli's new ability to have piped in data be the last argument of a command. vim -o file1.txt file2.txt file3.txt (opening multiple files with vim) Using vim instead of less as a pager: cat file.txt | vim -
sed -i does the same thing as perl -pi. Though I've not encountered a system that doesn't have both.
Awk. Actually a full programming language but i usually use it for quick one liners: http://gregable.com/2010/09/why-you-should-know-just-little-...
my ~/bin folder has ~50 different little scripts that handle all sorts of small tasks.
* Copying files across machines (`cat file| nc -l port` and `nc host port`)
* Remote pasteboard (on OSX w/ pbcopy, `while true; do nc -l port| pbcopy; done`)
Not a life changing, but I wish I know it earlier.
Only if there's a way to make "remote $EDITOR" with Netcat...
That reddit thread is delightful, because it is full of wonderful commands that I didn't know, or rarely use, or had forgotten. But it's also terrifying, because it exposes how many people will post questions before using man.
Awk. Actually a full programming language but i usually use it for quick one liners: http://gregable.com/2010/09/why-you-should-know-just-little-...
every developer should know sed and awk. it is amazing how many devs write cumbersome scripts or little programs to handle tasks that are built for sed and awk. my ~/bin folder has ~50 different little scripts that handle all sorts of small tasks.
Earlier quoted context omitted.
"!ssh" to run the most recent ssh command without having to type out the long list of arguments I use and the host name.
It helps to put your most frequent entries in ~/.ssh/config Host somewhere HostName somewhere.example.com User username IdentityFile ~/.ssh/somewhere_key.pub
let you set up hops when you don't have direct access to a server.
e.g. if you don't have direct access to serverB but have direct access to a serverA that has direct access to serverB
put this in your ~/.ssh/config file
host serverA
hostname serverA.domainname.com
host serverB
hostname serverB.domainname.com
ProxyCommand ssh serverA "nc %h %p"
then typing ssh serverB will log you on serverBdisown - bash built in.
You know how you always start that mega long rsync in an ssh session from your laptop and then realize you have to go offline halfway through? You forgot to start it in screen or nohup, didn't you? You can pause it (ctrl+z), background it (bg), and then disown it so it is protected from SIGHUP when you quit your ssh session. Bash (and, to be fair, zsh and others have copied much of this) has some wonderful job control features most people are completely oblivious of - even veterans of 20 years.
This is useful for finding and killing a process. ps -A | grep some text in program name upon getting the pid kill -9 pid
pidof
socat TCP-LISTEN:80,fork TCP:localhost:3001