Tag Archives: Bash

Bash script to monitor background processes

while [ 1 ]; do ps -ef | grep bzip2; echo “=============================================”; sleep 5; done; where: bzip2: is the process name or part of the process name Press Ctrl+c at any time to cancel the process

Tagged , | Leave a comment

How to split a text file in Ubuntu

Simple! Just use the “split” command, if no arguments are specified, it will split the text file to files each containing 1,000 lines of text.

Tagged , , | Leave a comment

A complete invisibility – anonymity – solution for Ubuntu

Based on some online articles and my previous posts, I created the following script which does the following: Generates and assigns a random MAC address to my wired card (eth0) and wireless card (wlan0) using the macchanger software described here … Continue reading

Tagged , , , | Leave a comment

Delete the last line in a text file using sed

sed -i ‘$d’ hobba -i: to change the file itself, not copy contents to another file or something$d: delete the last linehobba: the file name

Tagged , | Leave a comment

Insert a "new line" character in a text file using Bash

“echo -e “192.168.100.100\n192.168” >> hobba“  The ‘-e’ option does the magic, as it allows escape characters to be printed Source

Tagged | Leave a comment