I have a linux instance that I set up some time ago. When I fire it up and log in as root there are some environment variables that I set up but I can't remember or find where they came from. I've ...
I know what program > /dev/null 2>&1 does. It redirects the output to /dev/null and 2>&1 means to redirect the error output in the same place where the output is sent. My ...
I want to see a long listing for a single directory. When I type ls -lha, I see this: drwxrwxr-x 4 username groupname 4.0K 2010-08-05 09:55 files drwxrwxr-x 7 username groupname 4.0K 2010-08-05 ...
At work we do a nightly dump of our mysql databases. From day to day, I would guestimate that close to 90-95% of the data is duplicate, increasing as time goes on. ( Heck at this point some are ...
I would like to monitor one process's memory / cpu usage in real time. Similar to top but targeted at only one process, preferably with a history graph of some sort.
I use bindkey -v (for bash-ers set -o vi I think that works in zsh too) or vi(m) mode. but it bugs me that I don't have any visual cue to tell me whether I'm in insert mode or command mode. Does ...
Is there a better way to search my history file for a command than grep? I do have some idea what the command starts as, but I don't know how far back in the history it is. update: was formerly zsh ...
I'm looking for some common problems in unix system administration and ways that shell scripting can solve them. Completely for self-educational purposes. Also I'd like to know how would you go about ...
I would like to open up a file using less, and have it automatically scroll the file similar to tail -f. I know that I can do less file, and then hit Shift-F to forward forever; like tail -f. I need ...
I've always found it awkward when complex shell commands involve parsing text output with AWK. Basically we're converting structured data into text, then parsing the text again to get back at the ...
The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor: > cat setuid-test.c #include <stdio.h> #include <unistd.h> int ...
I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command line, because color makes the output more useful and intuitive. What options exist ...
Apart from what you can (arguably?) call the more popular shells (bash, csh, Korn, zsh) what other ones do you know and use and what unique features do they have? ps - One answer per shell would be ...
Using VMS DCL command scripts one can catch errors by using the on error command: $ on error then goto MyErrorHandler $ directory samiam.txt $ delete x.txt $ exit $MyErrorHandler: $ print ...
I have a script which calls two commands: long_running_command | print_progress The long_running_command prints a progress but I'm unhappy with it. I'm using print_progress to make it more nice ...
In VMS DCL one may embed data in a command file using $DECK and $EOD. What is Linux for this?