Unix shells are primarily glue programs designed to invoke and manage other programs. Many common tasks are performed by small external programs, often called utilities. In unix terminology, utilities include both shell built-ins and external commands. Utilities with their own tags awk Text ...
12
votes
8answers
3k views
Tool in UNIX to subtract dates
Is there any tool in Solaris UNIX (so no GNU tool available) to subtract dates? I know that in Linux we have gawk that can subtract one date from another. But in Solaris the maximum we have is nawk ...
10
votes
6answers
810 views
Linux tools to treat files as sets and perform set operations on them
Does anyone know of any linux tool specifically designed to treat files as sets and perform set operations on them? Like difference, intersection, etc?
14
votes
2answers
2k views
What does “--” (double-dash) mean?
I have seen -- used in the compgen command.
For example:
compgen -W "foo bar baz" -- b
What is the meaning of the --.
1
vote
3answers
1k views
How to recover data from a bad SD card?
I have a 4GB SD card with some family pictures on it that I need to recover. When I insert the card into my card reader, it shows up as an unknown 32MB device (as /dev/sde) and cannot be mounted. When ...
3
votes
1answer
70 views
Colour problem when capturing a png of the top panel of the screen
I want to capture a window as a png from within a bash script, using the window's ID. In this case, the window is the top panel. Using gnome-screenshot the colours are true, as per this image... ...
36
votes
12answers
12k views
Repeat a unix command every x seconds forever
There's a builtin unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For ...
15
votes
5answers
400 views
Is there any option with 'ls' command that I see only the directories?
Sometimes, I need to check only the directories not files. Is there any option with the command ls? Or is there any utility for doing that?
EDIT: I'm using Mac OS X, and ls -d gives me . even though ...
24
votes
4answers
927 views
What is the difference between a builtin command and one that is not?
Is there any intrinsic difference between a builtin command and another command which can nominally do the same thing?
eg. Do builtins get "special" treatement? ... is there less overhead running ...
5
votes
1answer
161 views
Is there a way to make perl -i not clobber symlinks?
A friend of mine points out that if you do:
perl -pi.bak -e 's/foo/bar/' somefile
when "somefile" is actually a symlink, perl does just what the docs say it will do:
It does this by renaming ...
10
votes
1answer
139 views
What do all the pictures on the front of the “Unix and Linux System Administration Handbook” represent?
I'm a newcomer to Unix and Linux, and I've been trying to get up to speed on everything. One of the guides I've used is the "Unix and Linux System Administration Handbook"
It's a pretty great book, ...
7
votes
3answers
286 views
Doing two things with output from a command
I have a program texcount that outputs the number of words in my LaTeX document. I can also pipe the output of this to sed to make the newlines TeX linebreaks and write this to a file which I can then ...
5
votes
9answers
382 views
What is/are the standard CLI program(s) to manage users and groups?
As the title says, I'm basically asking about user management from the command line (e.g. on a system where there are no graphical tools available). In the past I've used several different programs to ...
4
votes
2answers
112 views
What are all the items on the cover of the “Linux Administration Handbook”?
As I mentioned in What do all the pictures on the front of the "Unix and Linux System Administration Handbook" represent? I'm fairly new to Linux and Unix.
@jasonwryan provided an excellent ...
4
votes
4answers
249 views
Usage of dash (-) in place of a filename
For a command, if using - as an argument in place of a file name will mean STDIN or STDOUT.
But in this example, it creates a file with the name -:
echo hello > -
How can I make - in this ...
4
votes
1answer
199 views
How to use the ul command line utility
I wanted to answer http://unix.stackexchange.com/questions/3043/use-roff-to-underline-words with "just use ul, this command is meant specifically for underlining text", however I just can't grasp how ...