After a lot of use, your history file can become full of a lot of old commands… once in a while, it can be useful (and safer) to clean them up.
NOTE: this can be especially important if you have ever used a password as a command line parameter as it is stored without encryption in a text file.
cat /dev/null > ~/.bash_history && history -c && exit
This is a simple question, but one that often baffles users that are new to the command line of *nix.
To delete a folder and all of it’s contents (including subfolders) you must use
rm -rf example
Installing MySQL on Ubuntu requires only a few simple steps.
sudo apt-get install mysql-server
sudo netstat -tap | grep mysql
sudo vi /etc/mysql/my.cnf
sudo service mysql restart
To look for some simple performance and security suggestions:
sudo apt-get install mysqltuner
Adding a new user is equally easy…
mysql --user=root --password=mypassword mysql
CREATE USER 'myusername'@'%' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON *.* TO 'mydatabase'@'%' WITH GRANT OPTION;
NOTE: This allows access to the user from ALL hosts, it can be limited by replacing the
'%' with a specific hostname (such as ‘localhost’ if desired) for security.
After a clean install, or simply access to a new machine, I often find it helpful to enable colored prompts in the terminal/command line environment.
For standard Ubuntu / Debian / Linux environments, this only requires you to remove a comment from a single line in a config file.
/home/%USERID%/.bashrc you will find the following text, the last line simply needs to have the hash removed:
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
Open vi/vim or your editor of choice and remove it and you are done!
NOTE: If you are using Nautilus, you will not see this file as it is hidden, choose “View”, “Show Hidden Files” (CTRL-H) and it should appear.