Check These Out
Often I need to edit a bash or perl script I've written. I know it's in my path but I don't feel like typing the whole path (or I don't remember the path).
Killall5 will kill your session and redirect to login screen.
-Very useful when suffering display problems.
-Can use F1-F6
-Need to login in the particular console if not already
Sorted in human readable format.
Use multiple patterns with grep -v. So you can print all lines in a file except those containing the multiple patterns you specify.
I often need to send screenshots to other people to explain settings and whatever.
So I created this oneline which I use to create the screenshot with imagemagik, upload it via scp to my server and then the command opens an firefox tab with the screenshot.
The screenshot can be a region or a window.
You just have to replace the parts beginning with YOUR.
SSH can be controlled trough an ~ escape sequence. Example, to terminate the current ssh connection, type a newline, then the ~ character, and last a . character.
This is useful eg when an ssh connection hangs after you reboot a machine and the connection hangs.
This command will find the biggest files recursively under a certain directory, no matter if they are too many. If you try the regular commands ("find -type f -exec ls -laSr {} +" or "find -type f -print0 | xargs -0 ls -laSr") the sorting won't be correct because of command line arguments limit.
This command won't use command line arguments to sort the files and will display the sorted list correctly.
Handy if you are installing a new server or recovering an old one and you have a passwd file with the accounts you want to add to the server. If you edit the file so that only the accounts that you want to add are left this line will spit out the correct useradd lines. The uid, gecos and shell will be preserved.
From the other machine open a web navigator and go to ip from the machine who launch netcat, http://ip-address/
If you have some web server listening at 80 port then you would need stop them or select another port before launch net cat ;-)
* You need netcat tool installed