Tag Archives: linux

BASH prompt

I know it’s cliché, but I thought I’d post my BASH prompt just in case anyone finds it useful. Features include: username, host, and directory number of background jobs exit status of last command wall-clock time of last command current date/time horizontal rule to separate outputs resizable The duration of the last command is based […]

Finding an object file defining a symbol

I was working on a project that needed a tiny amount of functionality from another, much larger, project.  Rather than linking in all the object files, I wanted to keep to the minimum.  Unfortunately, some of the functions I called had very generic names, and I had no idea which object files they were coming […]

Viewing deleted-but-open files on Linux

On Linux, a file may be deleted (removed/unlinked) while a process has it open.  When this happens, the file is essentially invisible to other processes, but it still takes on physical space on the drive.  To find out how much space is taken up by these files, run: sudo lsof | awk ‘/deleted/ {sum+=$7} END […]

Linux pipelines

I recently had a Subversion working copy with several files that were modified because they should not have been under source control to begin with.  I had to find all the modified *.Plo files and remove the folders that contained them.  I ended up using this, which is the longest pipeline I can remember using: […]

Kubuntu 9.10

I just upgraded to Kubuntu 9.10. The upgrade pretty much just worked (unlike my horrible experience with the last one which left my computer unusable). A few settings got lost such as the default font size. Nothing broke, though. A few annoyances did get fixed. Among them was the fact that in 9.04, Flash audio […]

“sudo nice” versus “nice sudo”

While re-testing the script mentioned in my last post, I decided to play a little safer. I changed “sudo foo” to “nice sudo foo”. However, it turns out that on my machine (running Ubuntu 9.04), processes launched by sudo do not inherit niceness. From a web search, though, I gathered that they do on some […]

killall is your friend

I created a backup script that needed to run as root. For convenience, I named the script backupWeb.sudo and created a script called backupWeb that would call backupWeb.sudo with sudo. Of course, I forgot the .sudo suffix, and the script launched itself recursively. The result was a less-lethal fork bomb. My computer was nearly unresponsive. […]