January 04 2017

Cron with wget always created an empty file on server

Tagged Under :

Linux
I am trying to write a cron task to call wget on a url. The cron runs fine, but every time it runs it will creates a cron.php.X file in my home directory. I’ve tried to turn off output using the –quiet option but it’s still outputting a new file with every running.

December 13 2016

How the get total file inside the folder

Tagged Under :

Linux
On Linux without the GUI (Gnome or KDE) if you want to know how many files inside folder, you are unable to right click and select the properties to get the number of files inside the folder.

You can use below command to get number of files inside the folder

September 16 2013

Remove GUI (GDM, Gnome, X Window) from CentOS

Tagged Under :

Linux
If you install a CentOS server, but accidently also installed Desktop Environment such as GDM, GNOME or X Window, you can easily remove the GUI packages and return back to Command Line (CLI).

There are two ways to do that. You can simply disable GUI or completely uninstall it. I will provide steps to do both.

Temporary Disable GUI (GDM)
Open inittab with nano
nano /etc/inittab
change
id:5:initdefault:
to
id:3:initdefault:

Remove GUI

July 20 2013

Linux Default Gateway IP Address

Tagged Under :

Linux
In Windows Machine if want to check our IP Address or Gateway the easy method is use Command Prompt type ipconfig then it will lists down everything. But in LINUX it different.

In Linux, they call it ifconfig, open the terminal and type ifconfig it will lists down all the available network. But it didn’t print out the Gateway IP Address.

The easy way to print out Gateway IP Address command.
route -n | grep 'UG[ \t]' | awk '{print $2}'
Or, you can use others command to print out the Gateway.