Cheap Tickets to India

How to List Software Installed by Date on a Linux System

 Command Line, Linux  Comments Off on How to List Software Installed by Date on a Linux System
Jul 202015

Commands to List Software Installed by Date on Linux SystemsIt’s easy to get a list of all the software installed or upgraded on a Linux system.

If you’re running CentOS, RedHat or Fedora, just run the below command on the terminal to get the complete list of all software installed on your PC or server.

$ rpm -qa

If you’re running Debian, Ubuntu or Linux Mint, go with either of the below commands.

$ dpkg --get-selections

The following command will work fine too.

$ dpkg -l

Software Installed by Date

RPM Based Linux Systems

However, there are occasions when we’d like to know about the software on our Linux system by date of installation. Continue reading »

 Posted by at 12:00 am

How to Properly Reboot or Shut Down a Linux System

 Command Line, How To, Linux  Comments Off on How to Properly Reboot or Shut Down a Linux System
Jul 092015

How to do Clean ShutdownLearning how to do a clean shut down of a Linux system is important if you don’t want to mess up your computer.

Just pressing your finger on the power button will certainly shut down or reboot your Linux system. But it can also cause serious damage like data corruption.

Remember, Linux is constantly writing data to disk even if it’s not apparent to you. Also, Linux keeps data in memory although it might appear to have written the data to disk.

So it’s crucial to do an orderly shutdown of a Linux desktop or server.

When you do a clean or orderly shutdown, you’re essentially informing users and processes on the Linux system of the shutdown and blocking new logins.

In this post, we’ll cover various options to properly reboot and shut down a Linux system.

You must be root or use sudo to run the shutdown command.

When I tried to run shutdown without being root or using sudo, I got the following error:

[thomas@localhost ~]$ shutdown
Must be root.

Continue reading »

 Posted by at 2:35 pm

10 Key DU Commands for Linux Newbies

 Command Line, Linux  Comments Off on 10 Key DU Commands for Linux Newbies
May 202015

Simply put, the du command gives you the size (disk usage) of a directory and files.

In the face of growing storage requirements and huge data warehouses, familiarity with the du command would stand Linux newbies in good stead.

Here’s the synopsis of du from the man pages.

du [OPTION]… [FILE]…
du [OPTION]… –files0-from=F

Let’s now consider some key du commands that Linux system administrators will find extremely handy.

Default Command

$ du

Running the above command will spit out a list of all directories in the current working directory and their size.

Total size of the current directory (including sub-directories and files) is provided at the end.

Although the results will not mention it, disk usage output is given in Kilobytes.

Summary Output
Far too often, we just need summary size of a directory, not pages of details.

In such situations, we’ll go with the -s option.

$ du -s

It’s simple but not that user-friendly since the output is provided in Kilobytes (who uses Kilobytes in an era of Gigabytes and Terabytes).

Human Readable Format
When you use the -h option (-h stands for human readable format) with du, you’ll see an easy to grasp output.

$ du -h

Depending on their size, file and directory sizes are suffixed with K (kilobytes), M (megabytes) or G (gigabytes). Continue reading »

 Posted by at 12:00 pm

How to Flush IPTables Chains Selectively

 Command Line, How To, Linux  Comments Off on How to Flush IPTables Chains Selectively
May 132015

IPtables are a priceless resource for system administrators to secure their servers.

Given the ceaseless attempt by hackers working for money or thrills, every Linux server administrator must grasp the basics of IPtables.

In this post, I will assume that you already have IPtables installed and running on your system.

Once in a while, there might be arise a situation where you’ll have to flush the IPtables rules.

What is flushing?

Flushing basically refers to deleting the IPtables rules in a single chain or all chains.

Now you should know the difference between flushing and deleting on the command line with reference to IPtables.

In flushing, you’re just deleting the rules in a chain. Continue reading »

 Posted by at 5:03 pm

How to Find Version of Packages on CentOS

 Command Line, How To, Linux  Comments Off on How to Find Version of Packages on CentOS
May 122015

Find Version of Packages on CentOS
Every now and then, there arises the necessity for Linux administrators to find out what version of a particular package is running on a CentOS, RedHat or Fedora system.

As is to be expected, the commands to find out which version of a package is installed on RedHat, CentOS and Fedora are different from the commands for Ubuntu and its derivatives like the popular Linux Mint.

There are multiple ways to get the version of packages installed on CentOS, RedHat and Fedora. You can do it via the command line or through GUI utilities.

In this post, we’ll check out five simple methods to determine package version via the command line.

1. The first command line option that comes to mind when checking for the version of an application or package on CentOS  is yum info package_name.

$ yum info PACKAGE_NAME

Let’s see what version of the clamtk anti-virus software is installed on our CentOS 7 desktop.

$ yum info clamtk
Installed Packages
Name        : clamtk
Arch        : noarch
Version     : 5.15
Release     : 1.el7
Size        : 1.3 M
Repo        : installed

2. The yumdb method provides more information compared to the previous option.

$ yumdb info PACKAGE_NAME

With yumdb info, you not only get the package version number but other details such as checksum of the package (and algorithm used to produce it, such as SHA-256), repository, which user installed it, or whether it landed on the system as a dependency.

Let’s check out the yumdb command with an example.

Why not see what version of python is installed on our Linux system.

$ yumdb info python
     checksum_data = b03c388fe3fe1c711249564c96902852d129a0f4faf8a27accd660bf42ebab4e
     checksum_type = sha256
     from_repo = anaconda
     from_repo_revision = 1404557011
     from_repo_timestamp = 1404557037
     installed_by = 4294967295
     reason = dep
     (and more)

3. There’s another easy to remember option, rpm -qa which queries all currently installed packages.

$ rpm -qa PACKAGE_NAME

One of my favorite newsreaders on Linux is quiterss.

In the below command, we’ll see which version of quiterss is installed. Continue reading »

 Posted by at 6:14 pm  Tagged with:

Which Version of an App is Running on Ubuntu?

 Command Line, Linux  Comments Off on Which Version of an App is Running on Ubuntu?
May 122015

Many a time I’m flummoxed as to which version of an application/package is running on my Ubuntu (or Linux Mint) system.

For sure, finding the package version is not an issue when dealing with GUI apps like Libreoffice or the Cherrytree notes app. You just need to open the application and look under ‘about’ on the top menu bar. As simple as that!

Which App Version is Running on Ubuntu?

But for other non-GUI apps like, say the Guake terminal emulator or the Python version on your Ubuntu system, you must head to the command line.

So how do you find out the package version?

Thankfully, the command line provides several options to find out the package version installed on Ubuntu Linux.

On Ubuntu and its derivatives like Linux Mint, there are four ways to find out a package version.

1. The simplest way is the dpkg -l method.

$ dpkg -l PACKAGE_NAME

For instance, I know Cherrytree notes app is installed on my Linux desktop.

Let’s pull down our terminal and see what version of the notes appis running.

$ dpkg -l cherrytree
cherrytree  0.35.7-1~ppa1~trusty1 all  hierarchical note taking application

By the way, dpkg -s PACKAGE_NAME would work fine too.

2. There’s a second distinct method to check the installed version of a package on an Ubuntu, Kubuntu, Lubuntu or Linux Mint system.

$ apt-cache show PACKAGE_NAME

Let’s check out this command and see what version of the Guake terminal I have on my PC.

$ apt-cache show guake
Package: guake
Priority: optional
Section: universe/x11
Installed-Size: 762
Maintainer: Ubuntu Developers 
Original-Maintainer: Sylvestre Ledru 
Architecture: amd64
Version: 0.4.4-1ubuntu1
Provides: x-terminal-emulator

3. Now for the third method of finding out which version of an application is running on Ubunutu (and its derivatives). Continue reading »

 Posted by at 2:50 pm