Check These Out
Run netstat as root (via sudo) to get the ID of the process listening on the desired socket.
Use awk to 1) match the entry that is the listening socket, 2) matching the exact port (bounded by leading colon and end of column), 3) remove the trailing slash and process name from the last column, and finally 4) use the system(…) command to call kill to terminate the process.
Two direct commands, netstat & awk, and one forked call to kill.
This does kill the specific port instead of any port that starts with 50. I consider this to be safer.
The check an entire folder is a one-liner:
plutil -lint * | grep -v OK$
from Ed Marczak
if you're using wildcards * or ? in your command, and if you're deleting, moving multiple files, it's always safe to see how those wildcards will expand. if you put "echo" in front of your command, the expanded form of your command will be printed. It's better safe than sorry.
Gives information about user's home directory and real name and shell user is having.
I'm just a simple programmer. I find dig too verbose. host tells me alias(es) and IP address in a quick to grok format with nothing special to remember for input parameters.
With thanks to http://www.cyberciti.biz/faq/how-to-test-or-check-reverse-dns/
$ command | my_irc
Pipe whatever you want to this function, it will, if everything goes well, be redirected to a channel or a user on an IRC server.
Please note that :
- I am not responsible of flood excesses you might provoke.
- that function does not reply to PINGs from the server. That's the reason why I first write in a temporary file. Indeed, I don't want to wait for inputs while being connected to the server. However, according to the configuration of the server and the length of your file, you may timeout before finishing.
- Concerning the server, the variable content must be on the form "irc.server.org 6667" (or any other port). If you want to make some tests, you can also create a fake IRC server on "localhost 55555" by using
$ netcat -l -p 55555
- Concerning the target, you can choose a channel (beginning with a '#' like "#chan") or a user (like "user")
- The other variables have obvious names.