Tip #232 Deleting difficult filenames
To delete a file who's file name is a pain to define (eg. ^H^H^H) find it's inode number with the command "ls -il". Use the line below to find and delete the file.Read more »
Tip #189 Remove every file but one
It's easy to remove (or copy, move etc.) all files that match a given criteria, but harder to move all but ones excluded by a criteria.To do this we can combine grep's -v option with Unix command substitution:
Read more »
Tip #363 Finding log files X number of days old and deleteing them.
This is a script that I recently wrote to find the logs of my IDP that were over 90 days old and delete them.The script is pretty much self explanatory.
Read more »
Tip #553 Remove duplicate files
The script below will find duplicate files (files with the same md5sum) in a specified directory and output a new shell script containing commented-out rm statements for deleting them. You can then edit this output to decide which to keep.Read more »
Tip #307 Delete old files
Use find by time to delete files more than x days old. For example the command below will delete files more than one day old:find . -mtime +1 -exec rm {} \; Read more »
Tip #251 Argument list too long
ls | xargs rm
Sometime there are so many files in a directory than the rm command doesn't work
Read more »
Tip #823 Remove DS_Store files from shared folders
.DS_Store files are a hidden file created by OS X to store custom attributes of a folder such as the position of icons or the choice of a background image. By default, they are created in every folder accessed, even folders on remote systems (for example, folders shared over an SMB or AFP connection). This can soon leave your shared folders littered with these files.The command below will remove all DS_Store files from the current directory and any sub directories.
Read more »
Tip #468 Moved Trac and Subversion repositories to another machine/direct
CASE: You've relocated Subversion and Trac repositories to another machine/directories. You don't want to edit n+1 trac.ini files.You have for example:
/repos/svn-myprojects/my-first-project
/repos/trac-myprojects/my-first-project
/repos/svn-myprojects/my-second-project
/repos/trac-myprojects/my-second-project
...etc...
Change ALL trac.ini repository_dir settings:
trac-mass-repodir-edit.sh:
Read more »
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs