Archive for the ‘linux/BSD’ Category
OSX Terminal Cursor Movement
To configure it to Alt + left and right: - Open Terminal preferences (command + ,); - At Keyboard tab, select “control cursor left (or right)” and doubleckick it; - Left: Select the combo “modifier” to “option” and the action to \033b - Right: Select the combo “modifier” to “option” and the action to \033f
Macports Mysql Error: ‘./mysql/host.frm’ (errno: 13)
Annoying error after installing mysql server via macports. The fix is updating the owner of the mysql directory. Hopefully this will be fixed in new releases of the port.
sudo chown -R _mysql /opt/local/var/db/mysql5/
Stop the Bell: Bash and OSX Path Finder
Usually disabling the bell in a terminal window is easy, using the terminal preferences. However, sometimes you don’t have preferences that offer this option; for instance in the OSX Path Finder terminal, which is really useful while using a mac and definitley worth the $40.
Anyhow, to disable the bell and annoying formatting issue that occurs in Path Finder terminal just do this:
create a .inputrc file in your root home directory (/~), with the following line:
set bell-style none
Start a new terminal session and you’re good to go.
Linux Commands (to remember)
Use exec along with find. This can help with things like finding files and seeing their ls output.
find . -size +20000k -exec ls -alF {} \; or using du find . -size +20000k -exec du -h {} \; To replace a dos newline character
:%s/^M/\r/g
Remember, the ^M is [ctrl-v + ctrl-m] and not [shift-6].
Recursive delete for certain things.
rm `find /home/user/path -name ‘*.tmp’`