I've come across this issue once where I wanted to delete a symbolically linked directory (named foo for this example) on a CentOS box using the "rm" command, and I got this error message:
rm: cannot remove `foo/': Is a directory
which was a little frustrating although simple enough to resolve.
The mistake that led to generating this error message is that I used the autocomplete line by using the tab key to finish off the name of the directory, which is fine for most purposes, but in this particular instance of removing a symbolic link, it introduced an undesirable factor which is the forward slash tacked to the end of the directory name.
So the typed command looked like this: rm foo/ instead of just this rm foo
Basically, the RM command in bash refused to unlink the symbolic link because it saw it as a directory with content within.
So just in case someone else comes across this same issue, all you need to do is remove the trailing slash from the end of your command and the rm command will successfully remove your symbolically linked directory without any fuss.
Another approach is to use the "unlink" command followed by the name of your symbolic link and it'll also work just fine. Just note that the "unlink" command also will generate an error if it sees a trailing slash after the directory name.
So the correct syntax for removing a symbolically linked directory is this:
rm foo
Or
unlink foo
12/18/18
8/1/18
Delete Postfix queued emails From/To specific user
Or, if using sudo, just add sudo to the part immediately preceding "postsuper":
mailq | tail -n +2 | awk 'BEGIN { RS = "" } / user@domain\.com$/ { print $1 }' | tr -d '*!' | sudo postsuper -d -
Note: This command line was run on a CentOS 6.10 box with Postfix version 2.6.6
3/6/18
Import PEM cert or key into your keystore
Easiest way I know to import a PEM format cert or key file into your Java keystore involves two steps.
1- Convert your PEM format certificate into DER format by using the following command syntax:
openssl x509 -outform der -in yourcert.pem -out yourcert.der
2- Import your resulting DER format certificate into your "cacerts" keystore using this syntax:
keytool -import -alias youralias -keystore cacerts -file yourcert.der
1- Convert your PEM format certificate into DER format by using the following command syntax:
openssl x509 -outform der -in yourcert.pem -out yourcert.der
2- Import your resulting DER format certificate into your "cacerts" keystore using this syntax:
keytool -import -alias youralias -keystore cacerts -file yourcert.der
10/25/17
How to insert charachter/text into multiple lines in the Vi Editor
- Press <Esc> to enter command mode
- Press <Ctrl> + <V> to enter visual block mode
- Move <Up> / <Down> to select the columns of text in the lines you want to insert text
- Hold down <Shift> + <i> and type the text you want to insert
- Press <Esc> , then wait 1 second and the inserted text will appear on every line you selected in step 3
- Press <w> (To save) And <q> (To exit Vi), if you're done editing this file
Credit: Original Tip found at https://stackoverflow.com/a/253391
7/11/17
How to Install JAVA 8 (JDK/JRE 8u131) on CentOS/RHEL 7/6 and Fedora
After a long wait, finally Java SE Development Kit 8 is available to download. JDK 8 has been released on Mar,18 2014 for general availability with the many featured enhancements. You can find all the enhancements in JDK 8 here.
This article will help you to Install JAVA 8 (JDK/JRE 8u131) or update on your system. Read the instruction carefully before downloading Java from Linux command line. To Install Java 8 in Ubuntu and LinuxMint read This Article.
Downloading Latest Java Archive
Download latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell.
For 64Bit
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
# tar xzf jdk-8u131-linux-x64.tar.gz
For 32Bit
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-i586.tar.gz"
# tar xzf jdk-8u131-linux-i586.tar.gz
Install Java with Alternatives
After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package.# cd /opt/jdk1.8.0_131/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_131/bin/java 2
# alternatives --config java
There are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
* 1 /opt/jdk1.7.0_71/bin/java
+ 2 /opt/jdk1.8.0_45/bin/java
3 /opt/jdk1.8.0_91/bin/java
4 /opt/jdk1.8.0_131/bin/java
Enter to keep the current selection[+], or type selection number:4
At this point JAVA 8 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives
# alternatives --install/usr/bin/jar jar /opt/jdk1.8.0_131/bin/jar 2
# alternatives --install/usr/bin/javac javac /opt/jdk1.8.0_131/bin/javac 2
# alternatives --setjar /opt/jdk1.8.0_131/bin/jar
# alternatives --setjavac /opt/jdk1.8.0_131/bin/javac
Check Installed Java Version
Check the installed Java version on your system using following command.root@tecadmin ~# java -version
java version "1.8.0_131 "
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Configuring Environment Variables
Most of Java based application’s uses environment variables to work. Set the Java environment variables using following commands
- Setup JAVA_HOME Variable
# export JAVA_HOME=/opt/jdk1.8.0_131
# export JRE_HOME=/opt/jdk1.8.0_131/jre
# export PATH=$PATH:/opt/jdk1.8.0_131/bin:/opt/jdk1.8.0_131/jre/bin
Also put all above environment variables in /etc/environment file for auto loading on system boot.
Article Source & Credit:
Original article posted at the following URL:
https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
How to Install JAVA 8 (JDK/JRE 8u131) on CentOS/RHEL 7/6 and Fedora
Original article posted at the following URL:
https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
After a long wait, finally Java SE Development Kit 8 is available to download. JDK 8 has been released on Mar,18 2014 for general availability with the many featured enhancements. You can find all the enhancements in JDK 8 here.
This article will help you to Install JAVA 8 (JDK/JRE 8u131) or update on your system. Read the instruction carefully before downloading Java from Linux command line. To Install Java 8 in Ubuntu and LinuxMint read This Article.
Downloading Latest Java Archive
Download latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell.
For 64Bit
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
# tar xzf jdk-8u131-linux-x64.tar.gz
For 32Bit
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-i586.tar.gz"
# tar xzf jdk-8u131-linux-i586.tar.gz
Install Java with Alternatives
After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package.# cd /opt/jdk1.8.0_131/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_131/bin/java 2
# alternatives --config java
There are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
* 1 /opt/jdk1.7.0_71/bin/java
+ 2 /opt/jdk1.8.0_45/bin/java
3 /opt/jdk1.8.0_91/bin/java
4 /opt/jdk1.8.0_131/bin/java
Enter to keep the current selection[+], or type selection number:4
At this point JAVA 8 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives
# alternatives --install/usr/bin/jar jar /opt/jdk1.8.0_131/bin/jar 2
# alternatives --install/usr/bin/javac javac /opt/jdk1.8.0_131/bin/javac 2
# alternatives --setjar /opt/jdk1.8.0_131/bin/jar
# alternatives --setjavac /opt/jdk1.8.0_131/bin/javac
Check Installed Java Version
Check the installed Java version on your system using following command.root@tecadmin ~# java -version
java version "1.8.0_131 "
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Configuring Environment Variables
Most of Java based application’s uses environment variables to work. Set the Java environment variables using following commands
- Setup JAVA_HOME Variable
# export JAVA_HOME=/opt/jdk1.8.0_131
# export JRE_HOME=/opt/jdk1.8.0_131/jre
# export PATH=$PATH:/opt/jdk1.8.0_131/bin:/opt/jdk1.8.0_131/jre/bin
Also put all above environment variables in /etc/environment file for auto loading on system boot.
5/12/17
Find O.S Install - Deployment Date
Commands to find out the initial deployment or installation of your operating systems.
Linux Systems:
tune2fs -l /dev/sda1 | grep 'Filesystem created:'
OR
tune2fs -l /dev/sdb1* | grep 'Filesystem created:'
Windows Systems:
systeminfo|find /i "original"
Subscribe to:
Posts (Atom)
Quick HTTP to HTTPS - Apache2
There are several methods for redirecting your Apache-based website visitors who might type your servers URL using the plain (non-secure) HT...
-
This is to resolve auditd warning asking to specify an arch type for syscall events Sample auditd warning message: WARNING - 32/64 bit s...
-
I got a VBE6EXT.OLB could not be loaded error when I wanted to install this really great tool-set for Excel that I've been using for ye...
-
Problem: RPM package removal error msg "Error: ... Specifies Multiple Packages" Solution: Run rpm -ev with the --allmatches opti...