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

learn more… | top users | synonyms (1)

76
votes
2answers
20k 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 --.
31
votes
7answers
6k 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?
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 ...
20
votes
6answers
5k 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 ...
8
votes
5answers
26k 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 ...
9
votes
4answers
1k 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 ...
16
votes
9answers
10k 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 ...
21
votes
4answers
875 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 ...
12
votes
2answers
260 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 ...
27
votes
5answers
8k 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 ...
16
votes
4answers
5k 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 ...
17
votes
4answers
17k 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
2answers
269 views

tac command's option creates strange output [comprehension question]

Say I have this file, containing nothing but a b c b a Using tac --separator=a file in BASH [on a Debian based Linux], I get this: # empty line # empty line b c ...
3
votes
2answers
408 views

Are there any utilities to quickly add, list and remove command aliases?

I'd like to be able to quickly, on-the-fly add (and list/remove) command aliases so that they persist between shell restarts (as if they were added to .bashrc). Are there any ready ...
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 ...
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 ...
9
votes
3answers
1k 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 ...
8
votes
1answer
380 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 ...
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 ...
4
votes
2answers
2k views

How do I time a specific command?

(The linux equivalent of TimeThis.exe) Something like: timethis wget foo.com Receiving foo.com ... wget foo.com took 3 seconds.
3
votes
2answers
3k views

file block size - difference between stat and ls

I've noticed that when I do a: ls -ls file It provides block count, say 8 blocks. When I do: stat file I notice that the block count is 16, twice the number given by ls. The block size on my ...
9
votes
3answers
453 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 ...
4
votes
2answers
397 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 ...
4
votes
2answers
838 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. ...
8
votes
2answers
15k 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 ...
4
votes
3answers
1k views

Why doesn't uname -a return a useful identifier

I typed the command uname -a into my college's server and got this: 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:14:03 EDT 2011 i686 i686 i386 GNU/Linux Are they trying to hide the version of Linux that ...
2
votes
2answers
75 views

Is there a distribution-independent tool to autocompile+install dependencies?

I like the way e.g. ArchLinux' yaourt (or if you're not that lazy, abs+makepkg; and from what I read so far, Gentoo's ebuild as well) automatically take care of obtaining, compiling and installing ...
1
vote
4answers
81 views

What are considered utilities and applications?

Commands like cp, ls, chmod, pwd etc are called as utilities. I seem to not able to define what kind of things are called applications. Let's abandon GUI to make the definition more precise.
1
vote
3answers
2k views

How to check which process is using a given file descriptor?

Somewhere in the middle of my application, the framework I'm using (ROOT) gives me the following error: *** Break *** write on a pipe with no one to read it SysError in ...