Tracking down where disk space has gone on Linux?

When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time before any results are returned. Also, this is usually successful in highlighting the worst offender but I’ve often…

How do I copy all files and directories except certain ones over ssh?

Using the Linux command line, I use the scp command to copy up all the files and folders from a certain directory. However, I don’t like to consume wasted bandwidth for copying up things I rarely change like my tiny_mce folder. What’s the trick to copy up everything but skip a short list of folders?…

Find files with certain extensions

How can I use find to find all files that have a .xls or .csv extension? I have seen a -regex option but I don’t know how to use it. ================= ================= 2 Answers 2 ================= Why not simply use this: find -name “*.xls” -o -name “*.csv” You don’t need regex for this. If you…

How do you detach the 2nd screen from within another screen?

I’ve accidentally attached to a 2nd GNU screen session from within an existing screen session and cannot detach or issue commands to the inner screen. I remember figuring out how to do that before but completely forgot and would like to keep it as reference. One way is to detach the inner screen by doing…

Changing Unix group for files

I have a file that a colleague and I are editing together, on a Unix system. We are using Unix group permissions to edit it. We have one Unix group that we are both members of. Whenever I save the file, it changes the Unix group to one that he is not a member of….

Where are displays other than “:0”?

X Power Tools -book has a sentence about “:0”: Display 0 on the local computer, connected by a local connection scheme I tried to open a clock by “xclock -display :2”, but I got an error: Can’t open display: :2 How am I supposed to program if I cannot get displays working? Can you really…

What is Linux for $DECK and $EOD?

In VMS DCL one may embed data in a command file using $DECK and $EOD. What is Linux for this? ================= ================= 2 Answers 2 ================= You can embed data within shell scripts. How this works is shell dependent. However bash/perl etc. do this in similar ways, using a heredoc. e.g. in bash (and similar):…

What is Linux for SET FILE/ERASE_ON_DELETE?

In VMS one may tell the file system to write junk over the existing contents of a file when it is deleted. Here is the DCL command to identify the file for this kind of treatment: $ SET FILE/ERASE_ON_DELETE SAMPLE.TXT This allows the policy to be set at one point in time then later users…

Linux editor with VMS EDT like direction mode

VMS editor EDT allows one to use the keypad to control most of ones editing commands. One of the rather nice features is that the direction of operation can be set to “up” or “down”. This then effects commands like “move to next character” and “move to start of line”. Another feature is that there…