tr and sed are very powerful stream and character manipulation commands, Each has its own advantage with string manipulation.
tr vs sed usage and examples
Replace “hi” with “bye”
echo "hi hi" | sed 's/hi/bye/g'
output: bye bye
echo "hi hi" | tr 'hi' 'bye'
output: by by
While sed can replace strings tr can only replace characters,
so with complete string replacement sed is the way to go.
Replace “good” with “bad”
echo "good good" | sed 's/good/bad/g'
output: bad bad
echo "good good" | tr 'good' 'bad'
output: bddd bddd
tr is more like a mapping command, it’s like a set of rules:
The char “g=b”, the char “o=a”,”o=d” the last one will be the active one “o=d”.
Change ‘ ‘ to a new line:
echo "line1 line2" | tr ' ' '\n'
echo "line1 line2" |sed -e 's/\s\s*/\n/g'
As you can see tr is a lot easier for this job.
Disable all Active Directory users in a domain or a specified OU that have not logged on and were not created within X days and save the list to a csv file.
Download Disable Inactive Users Power-Shell Script
Disable-Inactive-AD-Users @ GitHub
Edit the script file and replace the following values:
- Log folder:
$LogFolder = “C:\Disable-Inactive-AD-Users\”
- Search base – Domain or Organizational Unit to search – use Distinguished Name (DN)
$OU = “OU=MyUsers,DC=domain,DC=com”
- Period of time (in days) a user has been inactive
$UnusedDays = 365
“Onyx is a standalone application that serves as a proxy between the vSphere Client and the vCenter Server. It monitors the network communication between them and translates it into an executable PowerShell code. Later, this code could be modified and saved into a reusable function or script.”
VMware Onyx Download
Download and extract Onyx on to your vSphere Client PC.
Run and configure
- Run Onyx and press the Connect button
- Input the vCenter Server IP address or host-name and “mark Launch a client after connected”
- Select “VMware VI Client” and input your vCenter user name and password
- vSphere Client will now launch using port 1545
- Return to Onyx and click start
Now every action you will do in the vSphere client will be translated to a PowerCLI command in Onyx.
Linux fg bg commands usage and examples using CTRL-Z and jobs command.
Move a process between background and foreground modes with paused and running states.
Usage and examples
Pause a process
When running a process you can use CTRL-Z to pause the process and free the current shell instance:
Linux jobs command
To view the stopped jobs use the jobs command:
You should receive something like this (Job number, Status, Command):
+ Stopped ls --color=auto -l --color=auto -lla -R /
Run a process in the background
You can start a process in the background from the start using an ‘&’ mark at the end of the command:
cp /source /destination &
linux fg bg commands
To move a job to the foreground execution (for example job 1):
To move a job to the background execution (for example job 1):
Kill paused jobs
To kill a paused job you can use the kill command followed by the job number (for example job 1):
This tutorial will explain how to install CM10.1 for Galaxy S3 i9300 (Android Jelly Beans 4.2.2).
Oracle Java CentOS 6 Installation and configure it as the default Java Runtime Environment.
WordPress SSL Encryption has several options so you can encrypt just the Log-in page, the entire Admin area or the entire WordPress instance.
OpenVPN ALS Adito SSL VPN Gateway is a web-based SSL-VPN server written in Java and it is completely free and open-source.
The installation on CentOS 6 Linux Operating System is fairly simple using the next few steps (we will use CentOS Minimal x86_64).
SSH X11 Forwarding Display is a tricky thing to establish on different Windows operating systems.
MobaXterm is a free Xserver and tabbed SSH client for Windows Operating Systems which allows you to run native Linux Applications like they are running on your Windows.
THIS TUTORIAL ONLY SUPPORTS TINYCORE 4
FOR TINYCORE 5 THERE IS A SOLUTION IN THE COMMENTS BELOW BY Alejo
Tiny Core Linux is one of the smallest Linux distributions out there.
We will show you how to customize Tiny Core Linux Remote Desktop Kiosk so it will automatically launch a Remote Desktop client and set a Static IP address.
Oracle VirtualBox has no GUI to resize VirtualBox disk VDI format so you need to use a Command Prompt utility called VBoxManager.
The famous RTS game Command & Conquer – Red Alert 2 by Westwood Studios was released on October 2000 but there are still many who consider this game a must.
Westwood Studios was bought by Electronic Arts (EA) in 1998, and closed by EA in 2003.
With the release of Microsoft Windows 8 the game Red Alert 2 stopped working.
Follow these next few steps to Fix Red Alert 2 on Windows 8 x32 and x64 bit.