To remove a filename beginning with a bracket.
Run the below
rm -rf \(sometext)
To remove a filename beginning with a bracket.
Run the below
rm -rf \(sometext)
If your having issues removing packages from yum after doing a yum remove and yum clean all.
Run the below
rpm -e --noscripts package
To remove spaces/trailing lines from a file run the below.
sed -e 's/^[ \t]*//;s/[ \t]*$//' FILE
To empty windows recycle bin via the command line.
Run the below.
Windows server 2003
rd /s c:\recycler
Windows7/Server 2008
rd /s c:\$Recycle.Bin
If you get the below error
Cannot Delete File: Cannot read the source file or disk
Then run the below command in cmd prompt to remove the file
'del "\\?\D:\Folder\Temp\filethatcantberemoved"
Run the below in the directory of choice to remove files + 3 days.
find . -mtime +3 -exec rm -rf {} \;
To remove the warning from a find if your using a grep.
Just add 2>/dev/null to the find command that your running.
find /directory/ -type d -maxdepth 1 -exec basename {} \; 2>/dev/null | grep -v lbr | egrep "*-10-*"
To remove from mutliple directories.
Use the below regex on the remove command.
rm {1..2}/somedir/somefile*
To delete all the mail within mutt.
Run the below when in the mutt interface.
shift D ~s .*
Then just quit the application and it will prompt to confirm the deletion of the mails.
Run the below Sed command to remove all blank lines.
Really handy
sed '/^$/d'