≡ Menu


Linux / Unix: Sed Substitute Multiple Patterns [ Find & Replace ]

I'm using the date +'%D_%T' to store Unix system date and time in a shell variable called $_now:

_now="$(date +'%D_%T')"
echo $_now


I'd like to replace / and : with _. I'm aware of the following sed command:

sed 's/\//_/g
> s/:/_/g' < <<"$_now"


How do I specify two pattern within the same sed command to replace | and : with _ so that I can get output as 01_20_12_16_10_42?
[click to continue…]

Debian / Ubuntu Linux: Install nmap Software For Scanning Network

How do I install nmap command under Debian or Ubuntu Linux based system for testing security of my own network?
[click to continue…]

Linux: Find Out My Machine (Host) Name

How do I find out my server name (machine name) under Linux operating systems using command shell?
[click to continue…]

Linux Install Google Chrome Browser [ Ubuntu, Suse, Debian, Fedora ]

How do I install Google Chrome browser under Linux operating systems? How do I install google-chrome-beta_current_amd64.deb or google-chrome-beta_current_x86_64.rpm file under Linux?
[click to continue…]

Gnome Find Drive Serial Number

How do I find out serial number information for my hard disk under Ubuntu Linux Gnome desktop environment?
[click to continue…]

Bash Script: Read One Character At A Time

I need to count one character at a time from input.txt. How do I read one character at a time under Linux / UNIX bash shell script?
[click to continue…]

Help: Old Employees Accessing The Linux Server

I've recently noticed that two of my former employees are still accessing one of our Linux box. Old user account wasn't deleted because it has some important files. How do I make sure account get deleted without losing files and email stored in the account? Can you describe a terminations clearance policy for an employee account including email accounts, forwarding aliases, ssh / ftp, and access to vpn dialup services under Red Hat Enterprise Linux server?
[click to continue…]

hdparm: HDIO_DRIVE_CMD(identify) Failed: Inappropriate Ioctl For Device

When I run hdparm -tT /dev/sda command under CentOS / RHEL I get the following error on screen:

Timing buffered disk reads: 908 MB in 3.00 seconds = 302.39 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

How do I fix this problem?
[click to continue…]

Linux Disable / Remove All NFS Services

NFS was not designed with security in mind, and has a number of weaknesses, both in terms of the protocol itself and because any NFS installation must expose several daemons, running on both servers and clients, to network attack. I use my CentOS based server only to server web pages and nothing else. How do I disable NFS services under RHEL / CentOS / Fedora Linux?
[click to continue…]

How To Use awk In Bash Scripting

How do I use awk pattern scanning and processing language under bash scripts? Can you provide a few examples?
[click to continue…]