small programs used on the command line to do a specific job

learn more… | top users | synonyms (1)

68
votes
2answers
17k views

What does “--” (double-dash) mean? (also known as “bare double dash”)

I have seen -- used in the compgen command. For example: compgen -W "foo bar baz" -- b What is the meaning of the --.
37
votes
3answers
8k views

What is the difference between curl and wget?

I am keen to know the difference between curl and wget. Both are used to get files and documents but what the key difference between them. Why are there two different programs?
32
votes
4answers
3k 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 ...
31
votes
7answers
5k 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?
29
votes
3answers
2k views

What is the point of the `yes` command? [duplicate]

This question concerns the yes command found in UNIX and Linux machines: Basically, what is the point (if any) and history of this tool? Are there practical applications for it? Can an example be ...
26
votes
5answers
7k 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
15k views

What is the mknod command used for?

I just started using Ubuntu as my main OS and I wanted to learn about things I should not do, and learn by the bad things people have done in the past. I came across these email about horror stories ...
21
votes
4answers
800 views

Are Linux utilities smart when running piped commands?

I was just running a few commands in a terminal and I started wondering, does Unix/Linux take shortcuts when running piped commands? For example, let's say I have a file with one million lines, the ...
20
votes
2answers
698 views

Why use install rather cp and mkdir?

I've seen in many places used install -d to create directories and install -c to copy a file. Why not use mkdir and cp? Is there an advantage in using install?
19
votes
6answers
4k views

A standard tool to convert a byte-count into human KiB MiB etc; like du, ls1

Is there a standard tool which converts an integer count of Bytes into a human-readable count of the largest possible unit-size, while keeping the numeric value between 1.00 and 1023.99 ? I have my ...
17
votes
4answers
12k 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 ...
16
votes
9answers
9k 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 ...
16
votes
4answers
4k views

Setting the window dimensions of a running application

I'm trying to start an application within Ubuntu (xfce or gnome) and via the command line and was wondering if there's a generic way to set the dimensions of a given window of a given app that is ...
14
votes
3answers
2k views

Why use superflous dash (-) to pass option flags to tar?

To create a tar file for a directory, the tar command with compress, verbose and file options can be typed thus: $ tar -cvf my.tar my_directory/ But it also works to do it this way: $ tar cvf ...
14
votes
8answers
2k views

What are the best general purpose programming tools to complement Vim?

I've been using Vim as my text editor for a little while now and I feel like I'm taking the long way to do anything. I use ctags to tag my code base for navigation and I use grep (although ...
13
votes
5answers
21k views

How can I use sed to replace a multi-line string?

I've noticed that, if I add \n to a patter for a substitute using sed, it does not match. Example: $ cat > alpha.txt This is a test Please do not be alarmed $ sed -i'.original' 's/a test\nPlease ...
12
votes
2answers
1k views

Is '-9' a flag to kill command?

What does -9 do? It does not show up in the syntax: $ kill kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] $
12
votes
2answers
254 views

`test` and `[` - different binaries, any difference?

I noticed while answering another question that test and [ are different binaries, but the [ manpage pulls up test's. Besides the requirement for an ending ], is there any difference? If not, why are ...
10
votes
5answers
3k views

Alternative to find?

Is there an alternative find program with a more conventional CLI interface? find works and expects parameters in a painfully different way from most other utils. Clarification: I'm looking for a ...
10
votes
3answers
2k views

Fix or alternative for mktemp in OS X

I'm looking at a bash script someone else wrote that uses mktemp: TEMP=`mktemp --directory` However, this line does not work on my machine (OS X 10.6). How would I fix this line so that it is ...
9
votes
3answers
445 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 ...
9
votes
3answers
913 views

Universal extractors

With an increasing number of archive/compression file formats, is there a single free/open-source command line tool to rule them all? Perhaps something with a consistent / unified set of flags? (note ...
9
votes
3answers
211 views

Store output of a command into a ring-buffer

I've got a long-running command that generates a lot of output on stdout. I'd like to be able to retain, for instance, only the last three days or the last gibibyte (avoiding cutting lines in the ...
8
votes
4answers
22k 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 ...
8
votes
2answers
1k views

Alternative to watch which support colors

I have a command (phpunit) which has a colored output. According to the watch, command I should be able to use the --color flag to allow color rendering to pass through. However, this isn't working. ...
7
votes
4answers
4k views

creating a sequence of numbers, one per line in a file

Is there a way to create out of thin air, a file that is a sequence of numbers, starting at a given number, one per line? something like magic_command start 100 lines 5 > b.txt and then, b.txt ...
7
votes
4answers
4k views

cp or rsync, is cp really worth it?

I hope this does not count as a question without a real answer, as I can't seem to find a good reason to use cp(1) over rsync(1) in virtually all circumstances. Should one typically favour rsync over ...
7
votes
2answers
11k views

How can I test the encoding of a text file… Is it valid, and what is it?

I have several .htm files which open in Gedit without any warning/error, but when I open these same file in Jedit, it warns me of invalid UTF-8 encoding... The html meta tag states ...
7
votes
1answer
440 views

Can hd and od replace each other?

hd and od are both dump viewers of binary content. Can hd be used wherever od is and vice versa?
7
votes
4answers
804 views

Can a file that was originally sparse and expanded be made re-sparse

I know that copying or transferring what was originally a sparse file without using a utility that understands sparse files will cause the 'holes' to be filled out. Is there a method or utility to ...
7
votes
2answers
118 views

Why is there a mix of symlinks and hardlinks in /bin?

I understand the technical difference between symlinks and hardlinks, this is a question about their use in practice, particularly I'm curious to know why both are used in seemingly similar ...
7
votes
1answer
341 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 ...
7
votes
1answer
59 views

Swap (exchange) two big files in limited environment

Let's say I have two flash memory devices 1GB capacity each. Let's also say each device contains one big file ~ 1GB size. Assuming, I have limited (64MB) RAM and no hard disk drive, what is the ...
6
votes
9answers
459 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 ...
6
votes
2answers
498 views

What commands have -h human readable option, and how can I enable it by default w/env variable?

I'm tired of using aliases or typing -h. I want human readable output 24/7. Is there a way to enable it all the time for all commands that offer it?
6
votes
1answer
495 views

Difference between references of Linux “utilities”, “commands” and “programs”

I read uses of the word "utilities" for commands/programs such as 'ls', 'chmod', 'mv', etc. Is "commands" is Linux referring to the same things as top, ps, etc., or are those something different? ...
6
votes
1answer
307 views

Interactive tree command

Is there any version of tree command that displays file structure as a tree structure, but in a way that I can interactively walk trough? Why do I need it exactly - I am trying to simulate TextMate ...
5
votes
4answers
2k views

In UNIX, how to find the most commonly used commands in history of unix?

In UNIX, how to find the most commonly used commands in history?
5
votes
1answer
137 views

How would one detect if external command exists in a script?

Is there a way to detect if an external command exists (i.e. wget, svn)? More specifically today, i was trying to run one of my scripts i wrote and the person didn't have wget or svn installed. The ...
5
votes
6answers
20k views

Console tool to test internet bandwidth

I'm looking for a tool that will test my internet connection bandwidth and create an simple report like speedtest does. Do you know some program/tool that do this? Something with CentOS packages ...
5
votes
1answer
466 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 ...
5
votes
1answer
303 views

`unbuffer` or `stdbuf` for removing stdout buffering?

Is there a difference between unbuffer(1) and stdbuf(1)? From what I gather, unbuffer makes more than the "best effort" of calling the libc function set(X)buf at the beginning, and then letting things ...
5
votes
2answers
1k views

Combine input from multiple files/pipes without clobbering lines or blocking?

Is there a tool that will take input from multiple files or pipes and write it to stdout, without blocking on reads, such that individual input lines come out intact? I basically want to multiplex a ...
5
votes
1answer
2k views

Are there alternatives for `dd`?

What other tools should I use to read and write files with truncation, seeking and skipping. dd's command line options seem inconvenient and foreign and I don't like choosing between slow, but precise ...
4
votes
5answers
8k views

How do I find the X window ID under the mouse pointer in bash?

From a bash script, is there some way to get the ID of the X window under the mouse pointer? (edit) I need the process to be non-interactive.
4
votes
3answers
425 views

General specification for command line interface

I was wondering where I can find and learn some general idea about the command line interface used in Linux and bash? As to now, I have found pieces of such information only from experience, such as ...
4
votes
2answers
89 views

Factor is too large

I'm trying to use a factor utility but it tells me that number is too large. Is there any utility that can do what factor doing but not tells that number is too large?
4
votes
2answers
795 views

Why is bash completion of a symlink different than a directory?

I usually do a find with an environment variable as the path when searching for source code. Recently I replaced my environment variable with a symbolic link, and it broke Bash's shell completion. ...
4
votes
2answers
2k views

wgetpaste alternatives?

Are there any wgetpaste alternatives?
4
votes
2answers
93 views

Convert file with integers written in ascii to binary file of integers

I have a file that contains a long list of integers written in ascii separated with newlines, like such: -175 2 -19345 345592 -45 2355 etc... I want to convert this file into a "binary" file ...