Operating Systems

How to open PDF files in Fedora/RHEL/Ubuntu Linux

Linux provides multiple options to open PDF files. If you are using GNOME as your desktop, ou can use “evince” application. If you are KDE fan, you can use “okular” application. Otherwise, you can try “xpdf” application as well.

If you are not sure about the name of Desktop you are using, just try all the commands at command-line and see if it works.

[neo@techpulp ~]# evince myfile.pdf
[neo@techpulp ~]# okular myfile.pdf
[neo@techpulp ~]# xpdf myfile.pdf

Typically you should have at least on of them installed in your system and should be able to open PDF files easily from the file manager.

You can use following More >

How to convert a number from decimal/octal to hexa-decimal format using bc command

The “bc” command provides an arbitrary precision calculator language. The bc command can be used to evaluate mathematical expressions in the non-interface method as well as interactive method.

A typical interactive usage of bc command to evaluate a mathematical expression “100+200″ is as follows. The output from bc command is highlighted below.

[neo@techpulp ~]# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
100+200
300
[neo@techpulp ~]#

A simple non-interactive way of using bash command to evaluate same expression is as follows.

[neo@techpulp ~]# echo "100+200" | bc
300
[neo@techpulp More >

How to view differences between two binary files in Fedora/RHEL Linux

The tool VBinDiff can be used to check the differences between two binary files. This tool displays data in hexadecimal and ASCII formats. This is a very small tool and can be installed in any Fedora/RHEL system using yum utility as shown below.

[root@techpulp ~]# yum install -y vbindiff
fedora                                                   | 2.8 kB     00:00
updates                                                  | 3.4 kB     00:00
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package vbindiff.i386 0:3.0-0.2.beta4.fc10 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package          Arch         Version                    Repository       Size
================================================================================
Installing:
vbindiff         i386         3.0-0.2.beta4.fc10         updates          41 k

Transaction Summary More >

How to disable colored display by ls command in Linux

Sometimes it is annoying to look at the colored display of output by ls command. This is more evident if you use a dark color as background color of the terminal. In such cases, you can use alternative command ‘dir’ to see non-colored output. However it is difficult for one to change the commonly-used command easily. In such case, you can run the following command to make ls command to display non-colored output.

[neo@techpulp ~]# unalias ls

However the above command affect only your current shell. If you want to make this permanent, you can place the command towards the end of More >

How to print date and time in different time zone using command line in Linux

The command “date” is used to display current date and time in Linux systems. The date command displays date and time in configured time zone in the system. The file /etc/localtime contains information about currently selected time zone. This file is copied from /usr/share/zoneinfo directory during system installation.

[neo@techpulp ~]# file /etc/localtime
/etc/localtime: timezone data
[neo@techpulp ~]#

If you want to change the current default time zone of the system, you should copy relevant file from /usr/share/zoneinfo directory to /etc/localtime file.

If you want to just display current date and time in a time zone other than default time zone, you need to set the More >

How to reboot a Linux system remotely using ssh or telnet

You can simply login to the remote system using SSH and execute “reboot” command to reboot it. But you must be logged in “root” user to be able to reboot the remote Linux system.

This example shows how to login using IP address.

[root@neo.techpulp.com ~]# ssh root@192.168.123.55

This example shows how to login using remote host name.

[root@neo.techpulp.com ~]# ssh root@www.techpulp.com

Typically after a successful login, you will get access to shell. You can run “reboot” command to reboot the remote system. This action will automatically terminate you current SSH session.

Otherwise, you use the following example to do the job with single command.

[root@neo.techpulp.com ~]# ssh More >

How to start or stop or restart a service in Fedora/RHEL/Ubuntu/Debian Linux

The following examples show how to start or stop or restart a service in different flavours of Linux. In all these examples, the service name “httpd” is used. You can replace it with name of the service you want to start or stop or restart.

Starting a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd start

or

[root@techpulp ~]# /etc/init.d/httpd start

In Debian Linux:

[root@techpulp ~]# /etc/init.d/httpd start

In Ubuntu Linux:

[root@techpulp ~]# sudo /etc/init.d/httpd start
Stopping a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd stop

or

[root@techpulp ~]# /etc/init.d/httpd stop

In Debian Linux:

[root@techpulp ~]# /etc/init.d/httpd stop

In Ubuntu Linux:

[root@techpulp ~]# sudo /etc/init.d/httpd stop
Restarting a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd restart

or

[root@techpulp More >