Tuesday, 16 September 2014

Echo Command - Writing Output on Screen

Echo Command

Echo is a shell built-in command used to display a line of text on standard output.

echo with -e option enables interpretation of backslash escapes

Some backslashes used for different purpose are:

alert (BEL)
suppress trailing newline
form feed
new line
carriage return
horizontal tab
vertical tab

Friday, 12 September 2014

Sharing a directory with Samba

Sharing Files and Directories with Samba

Update the global section of configuration file smb.conf as below


workgroup = WORKGROUP

server string = Samba Server

netbios name = LinuxSamba

security = share

Enter the name of workgroup, put server string name as you wish, write the netbios name and security as share.

Thursday, 11 September 2014

Date and hwclock Commands with Example

Date Command

Date command is used to display the current date and time or setting the system date and time on terminal or through ssh session.

date command Examples

To display the current date and time use date command

$ date

Thu Aug 28 17:50:29 IST 2014

To Display The Hardware Clock (RTC), you need to be root user to use hwclock command.

Thursday, 28 August 2014

Linux Command for calculation - bc

bc Command in Linux with Example

bc is a command line basic calculator. bc is typically used as either a mathematical scripting language or as an interactive mathematical shell.

Doing arithmetic calculation use bc as below.

bc can be used with echo command


$ echo "3+5" | bc


$ echo "15-3" | bc

Wednesday, 27 August 2014

Samba Server Configuration in Linux

Configuring Samba Server

To install Samba run command

yum install samba samba-client samba-common

The Samba Configuration file is /etc/samba/smb.conf

Take a backup of this file before configuring any samba share using command
mv /etc/samba/smb.conf /etc/samba/smb.conf.bkp

Minimal smb.conf

Here is an example of a minimum configuration of smb.conf

$ cat /etc/samba/smb.conf
workgroup = WORKGROUP
path = /srv/samba/public