≡ Menu

rm command

Linux: Bash Delete All Files In Directory Except Few

I'm a new Linux system user. I need to cleanup in a download directory i.e. delete all files from ~/Downloads/ folders except the following types:

*.iso - All iso images files.
*.zip - All zip files.

How do I delete all file except some in bash shell on a Linux, OS X or Unix-like systems?
[click to continue…]

HowTo: Unix rm All Files In a Directory

I am a new Unix user. How do I rm (remove) all files in a directory called personal-files under Unix like operating systems?
[click to continue…]

RHN yum command: Unable to read consumer identity Warning and Solution

I am using yum update command with RHN to upgrade packages installed on my server, but getting the following warning on screen :

yum update -y
Loaded plugins: product-id, protectbase, rhnplugin, security, subscription manager:
Updating certificate-based repositories.
Unable to read consumer identity
0 packages excluded due to repository protections
Setting up Update Process
Resolving Dependencies
--> Running transaction check

How do I get rid of this warning /error under RHEL 6 server?
[click to continue…]

Linux / Unix: Find and Delete All Empty Directories & Files

How do I find out all empty files and directories on a Linux / Apple OS X / BSD / Unix-like operating systems and delete them in a single pass?
[click to continue…]

HowTo: Linux Remove a Partition Name (/dev/sdXY entry) Temporarily

I'd like to remove /dev/sdc5 temporarily without deleting partitions on hard drive /dev/sdc under Linux operating systems?
[click to continue…]

Apple OS X: Remove a Symbolic Link (Symlink) Command

How do I remove a symlink under Apple Mac OS X using bash command line option?
[click to continue…]

Mac OS X: Delete SSH Keys Using Terminal Command Line

I have aws.sg.pub and ibm.sl.pub file for ssh login. How do I delete ssh key file called ~/.ssh/aws.sg.pub using the terminal on Apple Mac OS X?
[click to continue…]

UNIX: Recursive Delete Directory / Files

How do I delete (remove) a directory called $HOME/foo and its content including all files and sub-directories under Unix like operating systems? What is the best way to completely delete /tmp/foo/ with all it's content?
[click to continue…]

Mediawiki PHP Fatal error: Cannot redeclare wfProfileIn() Error and Solution

I'm running the Mediawiki software under Apache web server running on the Unix operating systems. I'm getting the following in my php error log:

PHP Fatal error: Cannot redeclare wfProfileIn() (previously declared in /var/www/html/wiki/includes/profiler/Profiler.php:14) in /var/www/html/wiki/includes/ProfilerStub.php on line 25.

How do I fix this problem under Mediawiki version 1.18.0?
[click to continue…]

Linux / UNIX: HowTo Empty Directory

How do I empty a directory (delete all files) under Linux / Unix without deleting directory itself?
[click to continue…]