by Vivek Gite on January 20, 2012 · 1 comment
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
Outputs:
01/20/12_16:10:42
I’d like to replace / and : with _. I’m aware of the following sed command:
sed ‘s/\//_/g
> s/:/_/g’ <<<"$_now"
Outputs:
01_20_12_16_14_09
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?
How do I find out my server name (machine name) under Linux operating systems using command shell?
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?
How do I find out serial number information for my hard disk under Ubuntu Linux Gnome desktop environment?
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?
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?
When I run hdparm -tT /dev/sda command under CentOS / RHEL I get the following error on screen:
/dev/sda:
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?