Tag: Unix

How to Change Your Mac Address in Linux

Short for Media Access Control address, a hardware address that uniquely identifies each node of a network. In IEEE 802 networks, the Data Link Control (DLC) layer of the OSI Reference Model is divided into two sublayers: the Logical Link Control (LLC) layer and the Media Access Control (MAC) layer. […]

Bash Shell Count Number of Characters In a String or Word

How do I count and print particular character (say D or digit 7) in a string or variable under Bash UNIX / Linux shell? You can use UNIX / Linux command such as sed, grep, wc or bash shell itself to count number of characters in a string or word […]

UNIX / Linux Shell Script For Monitoring System network with ping command

#!/bin/bash # Simple SHELL script for Linux and UNIX system monitoring with # ping command # ————————————————————————- # Copyright (c) 2006 nixCraft project <http://www.cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ————————————————————————- # This script is part of nixCraft shell script collection (NSSC) # […]

Unix scripts: how to sum numbers up

If you’re ever thought of summing up more than two numbers in shell script, perhaps this basic post will be a good start for your Unix scripting experiments. Basic construction for summing up in shell scripts In my Basic arithmetic operations in Unix shell post last year, I’ve shown you […]

vi Find And Replace Text Command

How do I find and replace (substitute) test using vi or vim text editor under UNIX / Linux / BSD or Apple OS X operating systems? Both vi and vim text editor comes with substitute command for finding and replacing text. Syntax The syntax is as follows: :%s/WORD-To-Find-HERE/Replace-Word-Here/g OR :%s/FindMe/ReplaceME/g […]

Unix Signals

A signal is a message which can be sent to a running process. Signals can be initiated by programs, users, or administrators. For example, to the proper method of telling the Internet Daemon (inetd) to re-read its configuration file is to send it a SIGHUP signal. For example, if the […]

Linux Password Protect Files

If you store private information on your Linux system and you want to prevent other people who use the system from viewing your private files, you need to password protect these files. Solution is to use following commands to encrypt or decrypt files with a password. gpg command GnuPG is […]

How To Tail (View) Multiple Files on UNIX / Linux Console

tail is one of the best tool to view log files in a real time (tail -f /path/to/log.file). The program MultiTail lets you view one or multiple files like the original tail program. The difference is that it creates multiple windows on your console (with ncurses). This is one of […]