Linux Archives

Quickzi: How To Delete Bash History

If you want to delete your bash history, there are a few options you have.  First you must understand that the history of your bash session is stored into RAM and then written to ~/.bash_history when you log out of the bash session.  So even if you delete the ~/.bash_history file, your current bash session will still be written to history once you log out.

Delete bash history

To delete the bash history for your current session as well as old sessions, you should do two things:

Delete the .bash_history file:

# rm -rf ~/.bash_history

Clear the current history stored in RAM:

# history -c

Stop writing to .bash_history for good

If you don’t want to log any history for good, you can do one of two things; turn it off for all users, or turn off logging history for a single user.

Turn off bash history for all users:

Append “unset HISTFILE” to /etc/profile:

# echo "unset HISTFILE" >> /etc/profile

Turn off bash history for a specific user:

Append “unset HISTFILE” to /home/USER/.bash_profile:

# echo "unset HISTFILE" >> /home/USER/.bash_profile

That’s it! Now you have successfully deleted the bash history and stopped logging to bash history.

Popularity: 34% [?]

Here is a quick tip on how to use sed to replace a line in a text file from the command line, without opening it.

Replace a Line in a File

First, replace the text you want with sed and output it into a temporary file to ensure that it is correct:

# sed -e 's/original-text/new-text/' textFile > newFile

View the newFile and make sure that the line is correctly replaced:

# more newFile

Overwrite the textFile with the newFile:

# mv newFile textFile

Popularity: 3% [?]

Here is a quick tip on how to use sed to add a line into the middle of a text file from the command line, without opening it.

To clarify, let’s say you have a text file that has four lines:

Line1Text
Line2Text
Line3Text
Line4Text

Using sed, you can append a line anywhere you want with a simple command without even knowing the line numbers.

Add a Line into the Middle of a Text File

For this example, lets say we want to append a new line under Line3Text:

# sed '/^Line3Text/a NewLineText' textFile > newFile

You’ll notice that we output the results to a newFile so that we can make sure the new line appended correctly before overwriting the original file.  If you check the newFile, you should see a correct output, then you can overwrite the original textFile.

# mv newFile textFile

Popularity: 4% [?]

The Linux Foundation and kernel developers alike have finally decided to speak out by issuing a statement on closed source drivers, recommending “that hardware manufacturers provide open source kernel modules.”

Here’s the entire statement:

The Linux Foundation recommends that hardware manufacturers provide open source kernel modules. The open source nature of Linux is intrinsic to its success. We encourage manufacturers to work with the kernel community to provide open source kernel modules in order to enable their users and themselves to take advantage of the considerable benefits that Linux makes possible. We agree with the Linux kernel developers that vendors who provide closed-source kernel modules force their customers to give up these key Linux advantages. We urge all vendors to adopt a policy of supporting their customers on Linux with open-source kernel modules.

Background Materials

There is no telling if the hardware manufacturers will take notice and actually adhere to the Linux Foundation’s statement, but at least they will know where the Linux community developers stand.  It’s obvious as to why the hardware companies don’t want to provide open source drivers, in order to remain competitive, but there has to be a tipping point at some point.

Visit the Linux Foundation website for more information.

Popularity: 3% [?]

Screencast Your Linux Desktop

Linuxhaxor.net has a great write up listing 5 different ways to capture a Linux desktop screencast.  The article highlights five screencasting applications for Linux: Istanbul, Wink, Xvidcap, vnc2swf and Recordmydesktop.

Read more here..

Popularity: 2% [?]

MySQL Change Password Tip

I keep getting the question on how to change a mysql root password. Here is a quick tip on how to change the MySQL password from the command line.

# /etc/init.d/mysql stop
# mysqld --skip-grant-tables
# mysqladmin -u root password 'newpass'
# /etc/init.d/mysql start

Change MySQL Password for a standard user

You can also change the mysql password for a standard user using mysqladmin.

# mysqladmin -u username -p oldpass newpass

Popularity: 4% [?]

openSUSE 11.0 Released

Congratulations to the openSUSE team for the release of openSUSE 11.0.

The openSUSE Project is proud to announce the release of openSUSE 11.0 — everything you need to get started with Linux on the desktop and on the server. Promoting the use of Linux everywhere, the openSUSE Project provides free, easy access to the world’s most usable Linux distribution, openSUSE.

The 11.0 release of openSUSE includes more than 200 new features specific to openSUSE, a redesigned installer that makes openSUSE even easier to install, faster package management thanks to major updates in the ZYpp stack, and KDE 4, GNOME 2.22, Compiz Fusion, and much more.

Download openSUSE 11.0

openSUSE is now available for immediate download. The openSUSE 11.0 release brings several new options for installation media, as well as familiar choices:

  • openSUSE 11.0 DVD
  • openSUSE 11.0 KDE 4 32-bit Live CD
  • openSUSE 11.0 GNOME 32-bit Live CD
  • openSUSE 11.0 KDE 4 64-bit Live CD
  • openSUSE 11.0 GNOME 64-bit Live CD

You can download openSUSE 11.0 via HTTP, FTP, BitTorrent, and Metalink from software.openSUSE.org.

You can also purchase a retail box with openSUSE 11.0 that includes 90-day installation support, physical media, and a printed Getting Started guide.

Popularity: 2% [?]

Mark Shuttleworth, the founder of Ubuntu, and Canonical Ltd., recently did an interview with Linux-Magazine Italia and he was kind enough to translate the Italian version to English and post it on his blog.

Here is a great question and answer from the interview:

3) Ok, let’s talk about the latest Ubuntu 8.04. In an interview you said that “Hardy Heron is your most significant release ever”. Well, can you talk about the main improvements of this release?
First, this is an LTS (“Long Term Support”) release that was delivered on a very precise schedule. Six months ago we committed to shipping 8.04 LTS on April 24th, and we did exactly that. As far as I know, nobody has ever shipped an “enterprise class” OS release on a schedule that precise. And not only did we do that, but we have now committed to ship the next LTS in April 2010, it will be 10.04 LTS, and we’ll set the exact date six months in advance like we did with this one. It is thanks to Debian and the free software community that it is possible for us to do this. So 8.04 LTS has proven our ability to deliver not just 18-month-supported releases on time, but also LTS releases on time. We very much hope that other distributions will follow our lead on the LTS cycle with their enterprise releases, because that will make it easier for us all to collaborate, and make all the major Linux distributions better.

Second, there are very significant new developments for Ubuntu itself. On the server, we worked with HP on their Proliant range, and with Dell on their PowerEdge range, to ensure that 8.04 LTS will be compatible with their popular x86 servers. We’re not yet certified, but we are sure that it will “Just Work”. Sun Microsystems has gone further, and has actually certified 8.04 LTS on a range of their x86 servers. This is a major step forward for Ubuntu on the server. We see an amazing amount of usage now for Ubuntu on the server – it’s the most popular server platform for several ISV’s. So it’s important that we work with server vendors, and server solution vendors. We’ve also put a lot of work into the use of KVM and VMWare virtualisation, because we see people building hundreds of virtual appliances on Ubuntu.

On the desktop, we have focused on making it easier to install Ubuntu, especially on a machine which already has Windows, where you can now install Ubuntu into a file on the Windows partition instead of having to resize your Windows partition to make a new partition for Ubuntu. That makes it much easier for people to test out Ubuntu, and hence to get a taste of free software. We have also worked on many of the common things that people want to do with their PC, such as work with photos and music, and started to improve the user experience there.

Read the rest of the interview here.

Popularity: 2% [?]

Linux Vocabulary for the New Linux User

If you’re just starting out with using Linux then chances are you’ve probably seen or heard a few Linux terms that you don’t recognize. It’s typical that when you ask, or search, for help on the Internet for Linux, you’ll see some of the following terms. I’ve put them in one place for you so that the next time you see a Linux vocabulary word you don’t know, you can check back here.

APT – Advanced Packaging Tool. APT simplifies the process of managing packages on Linux by automating the retrieval, configuration and installation. Generally, you’ll find APT on a Debian or Ubuntu distro.

BashBourne Again Shell is generally the default shell in most Linux distributions. When someone refers to a shell or the command line the Bash shell is usually what they are referring to.

CLI – The CLI is known as the Command Line Interface.  When you open a terminal, or if you do not use a Window Manager, or X11, you are operating on the CLI.

Dependency – A application, library, or development set that a package depends upon to work.

Distro – Short for Distribution, a distro is a set of programs combined with the Linux kernel to create an Operating System.

GNOME - Can be called a “complete” desktop environment for Linux. Gnome is the default desktop on the popular Ubuntu distribution.

GRUB – Another boot loader for Linux. Allows users to have several different Operating Systems on their system at once, and choose which one to run when the computer starts.

KDE- KDE or the K Desktop Environment, is desktop environment for Linux workstations.

Kernel – The core, or “brain” of Linux. The kernel is what controls the hardware and is what every Linux distro is built upon.

LILOLinux LOader. Similar to Grub, LILO is a boot loader for Linux. LILO usually writes to the Master Boot Record (MBR) on your device.

Linus Torvalds – The man who wrote the Linux kernel in 1991.

Man – Short for manual. If someone says “read the man page” or “rtfm” when you ask a question about a command, they want you to type “man command”.

Root – The superuser account on all Linux systems.

RPM – A package manager, which can be used to build, install, query, verify, update, and erase individual software packages. RPM is used by default on the Red Hat and Fedora distributions.

Sudo – Stands for Super User DO, allows a user to have root access without logging in as root.

Tux – The Linux Penguin

YAST – Stands for Yet Another Setup Tool.  Typically used on the SuSE distro.  Yast is a setup and configuration tool.

YUM - An automated update program which can be used for maintaining systems using rpmYum is also used on Red Hat and Fedora by default.

X / X11- Also known as the X Window System, X is a windowing system that provides the standard toolkit and protocol with which to build graphical user interfaces (GUIs).  KDE and GNOME are built upon X11.

Can you think of any other vocabulary words for Linux newbies that should be on this list?  Please, share your ideas in the comments below.

Popularity: 4% [?]

Quickzi: How To Log Boot Messages in Ubuntu

Here is a quick Linux tip to log your boot messages in Ubuntu.  This is great for checking for any errors or failed startups that may be happening during boot.

Edit /etc/default/bootlogd:

# vi /etc/default/bootlogd

You’ll see the following lines:

# Run bootlogd at startup ?
BOOTLOGD_ENABLE=No

Change No to Yes:

# Run bootlogd at startup ?
BOOTLOGD_ENABLE=Yes

Now every time your computer restarts, a /var/log/boot file will be created.

Popularity: 7% [?]