File::path - removing all files and directories keeping the root directory in place

keep_root => $bool

When set to a true value, will cause all files and subdirectories to
be removed, except the initially specified directories. This comes in
handy when cleaning out an application's scratch directory.

remove_tree( '/tmp', {keep_root => 1} );

removing duplicate files in a array

use List::MoreUtils qw(uniq);

my @dup_list = qw(1 1 1 2 3 4 4);

my @uniq_list = uniq(@dups);

mysql two columns having duplicate entries

select article_id, category_id, count(*) from FEATURED_ARTICLE group
by article_id,category_id having count(*) > 1 ;

how to disable the lock screen mode on your fedora pc

From the gnome panel: Desktop/Preferences/Screensaver

From the command line: /usr/bin/xscreensaver-demo

how to print one line after the given grep pattern

grep's -A 1 option will give you one life after; -B 1 will give you
one line before; and -C 1 combines both to give you one line both
before and after.

example : dig google.com |grep -A 1 "ANSWER SECTION" |grep -v "ANSWER SECTION"

rsync example

rsync -avz -e ssh rsync@remote.acme.com:/home/rsync/out/ /home/rsync/from_remote

Other Articles

Enter your email address: