Posts Tagged ‘cli’
Putty and Openssh
Putty is a nice cross-platform toolset with terminal emulator and keypair generation tool (puttygen) among others, but when you want to take your keypair with you to a normal Linux environment (meaning OpenSSH and the ~/.ssh directory), then you cant just copy-paste the keys under the .ssh directory. There are some formatting issues and after some research I found out that fortunately you can convert a Puttygen generated keypair into normal OpenSSH format. So here’s a memo of these commands (-O means what to export and -o gives the name of an output file):
puttygen putty_generated_private_key_file.ppk -O private-openssh -o id_rsa
puttygen putty_generated_private_key_file.ppk -O public-openssh -o id_rsa.pub
After that you just copy-paste the id_rsa and id_rsa.pub files under your ~/.ssh directory.
Further reading:
puttygen man page
How to get Ubuntu version and nickname
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 7.10
Release: 7.10
Codename: gutsy
As you can see, it also mentions that annoying codename that I keep forgetting. Now I’ll hope I’ll remember that command.
Bash keyboard shortcuts
Here’s a piece of useful information to all who have to use Unix/Linux CLI once in a while.
Via How-To-Geek.
| Ctrl + A | Go to the beginning of the line you are currently typing on |
| Ctrl + E | Go to the end of the line you are currently typing on |
| Ctrl + L | Clears the Screen, similar to the clear command |
| Ctrl + U | Clears the line before the cursor position. If you are at the end of the line, clears the entire line. |
| Ctrl + H | Same as backspace |
| Ctrl + R | Let’s you search through previously used commands |
| Ctrl + C | Kill whatever you are running |
| Ctrl + D | Exit the current shell |
| Ctrl + Z | Puts whatever you are running into a suspended background process. fg restores it. |
| Ctrl + W | Delete the word before the cursor |
| Ctrl + K | Clear the line after the cursor |
| Ctrl + T | Swap the last two characters before the cursor |
| Esc + T | Swap the last two words before the cursor |
| Alt + F | Move cursor forward one word on the current line |
| Alt + B | Move cursor backward one word on the current line |
| Tab | Auto-complete files and folder names |