How to copy Entire Directory in Linux

Command is simple, here i provide two samples to show how to copy entire directory in linux. cp -r sourcedir targetdir for instance, 1) Copy anything from current directory to /usr/local/download cp -r * /usr/local/download 2) Copy whole directory (include content) /usr/local/fromdownload to target /usr/local/download cp -r /usr/local/fromdownload /usr/local/download

Fedora Password is Strong !!!

Fedora you are strong !!! Here i share a bit funny stuff, regarding when i reset my postgres user password in fedora core 8. Please view below picture. Actually i just want to set a easy remember password for user postgres. However i unable to do it. First i enter password as “password” Fedora : …

Read more

How to set environment variable on Ubuntu

On Ubuntu, there are two system-wide environment variables, both files need admin or sudo to modify it. /etc/environment – It is not a script file, purely assignment expressions, one per line. /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64 LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/postgresql/8.3/lib /etc/profile.d/*.sh – Files with .sh extension in the /etc/profile.d/ folder. /etc/profile.d/myenv.sh export JAVA_HOME=JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64 export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/postgresql/8.3/lib export PATH=$PATH:$JAVA_HOME/bin Further Reading: Ubuntu …

Read more

How to find large file size on linux

Often time, you may need to know which file contains large file size, and delete it to save space. Here’s a code pattern to show you how to find large file size on Linux : find {directory} -type f -size +100000k -exec ls -lh {} \; | awk ‘{ print $9 ": " $5 }’ …

Read more