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

learn more… | top users | synonyms (1)

19
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 ...
8
votes
2answers
429 views

Finding a file type assuming wrong extension

I have an image archive I keep up. Sometimes, the sites I pull them from reformat the file while keeping the extension the same, most often making PNG images into JPG's that are still named ".png". ...
2
votes
2answers
58 views

Check files for conventions

I need a script that checks and lists all text files for project conventions. With conventions I mean for example: UTF-8 encoding No trailing white spaces Newline at the end of file No not-ascii ...
11
votes
3answers
3k 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 ...
1
vote
1answer
96 views

Ubuntu runuser command?

I am creating a bash script that requires to run commands as a specific user. As a result I am using the command: runuser I have tested this script and it works perfectly in Ubuntu Server 14.10. ...
4
votes
6answers
9k 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.
6
votes
6answers
22k 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 ...
2
votes
1answer
33 views

Problem with install command to copy a whole directory

So I have a repo with some of my config files and I'm trying to create a makefile to install them in the homedir. The problem I have is that when I run the following command straight in bash install ...
0
votes
0answers
22 views

Change encoding of a text file in-place: iconv alternative? [duplicate]

Apparently, iconv is unable to use the same file as input and output file. Other tools, e.g. sed, have an -i switch that allows "updating" a file in-place. (Under the hood, temporary files are ...
4
votes
4answers
281 views

How do I show the numeric character sequence of a string?

Is there a command either standalone or in vi or similar (can be gui) that will show me the numeric sequence of a string? Input: The cat hopped in a box. Output: T h e c a t h o p p e d ...
2
votes
1answer
71 views

Tool to give only the built linux source code

Linux is large complex piece of software. A running kernel in the system would not be using all the code. I'm looking for a tool which can give me the source code needed for the .config I used to ...
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 ...
0
votes
0answers
21 views

Makeself --notemp clean up

I am using makeself to have a self extracting installer package, on the target system I have a /tmp directory that is set to noexec. Thus, I am trying to figure out a way to use makeself without ...
9
votes
4answers
289 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 ...
2
votes
2answers
954 views

How to “List Disk” in Linux

In Windows, all you have to type is "List Disk" using DisPart in a command prompt and it'll list all physical storage devices available, their size, format, etc. How do I do this in Linux?
25
votes
5answers
33k 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 ...
5
votes
2answers
21k views

How do I get UUENCODE to work?

I have a server that I have inherited that has an older version of Redhat installed due to software requirements and now there is a need to use UUENCODE to allow email attachments. The uuencode and ...
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 ...
7
votes
2answers
497 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?
0
votes
1answer
17 views

2.6.35 armel header files?

Debian does not seem to include a package linux headers 2.6.35-9 for the armel chipset - compiling drivers work, but insmod, and insmod -f is failing with a version mismatch and invalid moduel format. ...
8
votes
1answer
381 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 ...
1
vote
1answer
34 views

Log new files in a directory

Is there a tool, which lets me know about the last newly created files? The still common way of using a hierarchically file system makes it hard to save files in different places, so sometimes I sort ...
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
2k views

Does hexdump respect the endianness of its system?

On my machine I get the following output when I run these commands: $ echo foos > myfile $ hexdump myfile 6f66 736f 000a The output from hexdump is little-endian. Does this mean that my machine ...
40
votes
3answers
10k 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?
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 ...
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 ...
4
votes
2answers
420 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 ...
6
votes
4answers
2k views
3
votes
0answers
51 views

What are good document organization utilities? [closed]

I'm a graduate student and I have to deal with reading a lot of academic papers. I was wondering if there were any good utilities for linux for organizing documents (pdfs mostly) for reading. Having ...
4
votes
2answers
110 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?
0
votes
0answers
77 views

Tools to inspect local network, and find local IP address of device?

This is my specific context (Latex/TikZ code for the diagram below): Now this local "Router", has broke down several times, and several different devices have had its role (sometimes they have a ...
0
votes
1answer
258 views

Is expect tool availabe for ARM platform

I need to get expect (tool for automating interactive applications) for the ARM platform. Is it a readily cross compiled to ARM and is it available? I tried googling but was unable to get the ...
2
votes
1answer
218 views

alternative for digest -a sha256 command from solaris in linux

I have file from solaris which have digest -a sha256. But this command is not working in linux. I want the alternative for this command.
0
votes
1answer
551 views

What does chmod stand for?

In order to memorize a command, it is usually a good idea to learn where it's name comes from. For example, cp comes from copy. usermod means "User Modifiy" (at least I guess so). Where does chmod ...
0
votes
2answers
799 views

Phrase Express Equivalent for Linux?

Is there some sort of auto text-insertion program with macros, similar to PhraseExpress for Windows in Linux? In case you've never seen this application it offers the following features: Organize ...
1
vote
1answer
124 views

On why touch, mv, etc., won't create subdirectories “as needed”

There are many Unix commands that will fail unless some subdirectory already exists, even though it would be a trivial matter for such commands to go ahead and create the missing subdirectory before ...
-5
votes
1answer
80 views

What does -p do when creating directories

What does the following command do to my system? $ mkdir -p /tmp/aes I typed the following command into my command line and it executes as expected. I know the folder is created as when I attempt ...
79
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 --.
3
votes
2answers
228 views

How can I get the version of the pgrep & pkill commands?

I looked at the manpages and there is no -v or --version argument for pgrep or pkill. How can i get some info on the version? I'm asking because on my version of Ubuntu man pgrep is giving me a ...
3
votes
2answers
117 views

Tool to force use FILE instead of RAM

I'm wondering why there is no such tool like ram2swap, similar to cpulimit in parts. E.g. There is program daemon.bin. Let's create temporary swap file ( 1 Gb ): % dd if=/dev/zero of=tmp.swap ...
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.
7
votes
1answer
62 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 ...
0
votes
3answers
66 views

How to find the difference in tokens in two strings using Unix tools?

I have two strings as below- token1, token2, token3, token4, token5, token6, token8, token9, token10 token2, token7, token4, token3, token5, token6, token8, token10, token9 Visually, I can see ...
1
vote
0answers
122 views

List/query Open X11 Display Connections?

I am hitting this bug: NEWT errors when closing sketch on Linux · Issue #1651 · processing/processing · GitHub, when using Processing on Linux (Ubuntu 11.04); my messages are: X11Util.Display: ...
1
vote
3answers
76 views

Use Unix tools to look for a definition block in an XML.

I am using an XML that has definitions in this form - <definition name="ticketOpen" extends="ticketUpdate"> <put name="title" value="Open Ticket" /> <put name="mainForm" ...
1
vote
1answer
27 views

Utility to tag regions of audio files

For example, say I have a recording with lots of noise and people speaking, I'd like to tag areas where people are speaking with a 1, and by default everywhere else is 0. Then save this file ...
0
votes
3answers
112 views

running an executable in parallel by dividing the input directory tree

Commands like find and grep would benefit greatly if they were to run in parallel. Is there a utility or a program that takes a command as an argument and makes it run in parallel by running multiple ...
1
vote
3answers
3k views

touch: cannot touch file: No such file or directory

I am getting the error: touch: cannot touch `/opt/tsrm/compliance/cme/log/20121207.log`: No such file or directory on the touch command: touch $LOGFILE I also checked the link: touch: cannot ...
0
votes
0answers
133 views

Video tools for creating presentation

I have captured video (with audio) from presentation, slides (just images), and array of times (when slides was listed). Goal is to create presentation video: big slide with small video frame at the ...