Not really code, but still something I need often enough to write it down. This command will list all files in a Linux folder sorted by date with the most recently updated files at the bottom. ls -ltrh From the ls man page, here’s what each of the choices do. -l – Uses a Long… Read more »
Posts Tagged: linux
This snippet will let you run the same command using each line from a file as a parameter. cat filename.txt | while read in; do echo “$in”; done As written it’ll open up filename.txt and echo out every line. Probably not what you want, so replace echo “$in” with whatever command you want to run…. Read more »
Fighting against an issue with the sendmail queue getting filled with junk I needed a way to delete a folder full of messages, and there were too many for rm to delete. A post on Stack Overflow had the solution. Only thing I added was the -v option to rm so that it displays the… Read more »
Came across an error after mistakenly clicking a link in my hosting control panel. At the time, WHM was working but none of the sites on the server would load. Trying to restart httpd manually from PuTTY resulted in an error that httpd.conf couldn’t be found. Fortunately, there was an easy fix. It’s a script… Read more »
Well, I am for now. I noticed Baidu pretty much on a forum of mine 24/7, but I didn’t recall ever seeing them show up in the referrer logs. Over the past year, across the sites on my server, they’ve made almost 35,000 requests for pages; chewed up 337 megs of bandwidth, admittedly not a… Read more »
Looks like Apache2 is installed in Ubuntu with mod_rewrite, but it’s disabled by default. Fortunately a quick drop to the terminal followed by restarting Apache2 and it’s fixed.