- Published:
- June 18, 2010 – 6:05 pm
- Author:
- By Dave
We received a tip from blog readers Christian and Michael for alternatives to the command to delete all directories older than a certain period of time. These both work in bash and can be used in scripts to clean up old backup directories or any situation where you need to delete old directories from the [...]
Categories: Linux,Shell,System Administration
Tagged: bash, oneliner, tips
- Published:
- February 23, 2010 – 5:41 pm
- Author:
- By Dave
My professor sent us this little one liner (ok, I had to format it to 2 lines to fit in this blog. You know what I mean) which prints out the current directory tree: ls -R | grep “:$” | sed -e ‘s/:$//’ -e ‘s/[^-][^\/]*\//–/g’ \ -e ‘s/^/ /’ -e ‘s/-/|/’ What’s going on here?
Categories: Code Samples,Shell
Tagged: bash, sed
- Published:
- February 13, 2010 – 1:12 pm
- Author:
- By Dave
The Bash command environment, which is the namesake of this blog, is very flexible in that it allows you to manipulate the filesystem in many ways. Awk and sed are very powerful tools that allow you to do this rename with a simple one line command. This post will walk you through doing this with [...]
Categories: Code Samples,Linux,Shell,System Administration
Tagged: awk, bash, csv
- Published:
- January 31, 2010 – 9:53 pm
- Author:
- By Dave
It is very easy to create a random file using the linux command line. Much like the command to fill a file with all zeros, for example a 1 Meg file: dd if=/dev/zero of=zero.filename bs=1024 count=1000 You do the same using /dev/urandom: dd if=/dev/urandom of=random.filename bs=1024 count=1000 Resulting in a 1MB file: 1000+0 records in [...]
Categories: Code Samples,Linux,Security,Shell
Tagged: command line, Linux, tips
- Published:
- August 5, 2009 – 9:16 pm
- Author:
- By Dave
You’ve flashed your old WRT54G or other vanilla router with the Tomato firmware. This itself turns your router into a lean, mean routing machine with QOS, SSH and more, but let’s say we want to take it a bit further. What it we want to get some more stats out of it? In order to [...]
Categories: Code Samples,Configurations,Hardware,Linux,Other Code,Programs,Shell,Software,System Administration,Tech
Tagged: cacti, firmware, network, router, SNMP, sysadmin