Tagged Questions

The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

2
votes
1answer
302 views

rotating buffer type file logging utility

I'am trying to debug a server that throws a lot of logs on stdout/stderr. I need to redirect only last N lines to a file. Something like a rotating buffer feature there in tcpdump's -C & -W flags. ...
3
votes
1answer
2k views

Convert a folder of images into a multi-page pdf file usind command line tools?

I have a folder with 100 jpg images. I want to convert these images into a multi-page pdf file, with all the images (cropped to A4 size). They are already in the correct rotation. Which tools should ...
6
votes
5answers
2k views

How can I run `watch` as a background job?

When I run: watch 'cmd >> output.txt' & the job gets suspended by the system: 3569 Stopped (tty output) Is there a workaround?
2
votes
3answers
869 views

Change character position with sed

The file contains: dateutkfilename25012009 I want to change the position of character 16th to 17th with 18th to 19th. And then change position of character 16th to 19th with 20th to 23rd... so it ...
2
votes
2answers
3k views

Add carriage return to output of `tail` while using `grep`

I'm looking to refactor the following command: tail -f production.log | grep -e "Processing " -e "compatible;" -e "Completed in " -e This is the output of the command: Processing ...
2
votes
2answers
821 views

creating simple command for sudo apt-get install?

I need to run these commands very often: sudo apt-get install <package> sudo apt-get remove <package> Can I make it simple like: install <package> remove <package> I ...
4
votes
2answers
5k views

How to list ALL directories according to their size? [without including the parent directory]

I have a bunch of random folders, some of them are hidden (beginning with a period). I want to list all of them, sorted by their sizes. I have something on the lines of this in mind: ls -d -1 -a */ ...
7
votes
4answers
551 views

How can I find a file whose name includes a given string, such as “abcde”?

Within a set of directories, how do I find a file whose name includes a given string, such as "abcde"?
10
votes
2answers
1k views

Where has the trailing newline char gone from my command substitution?

The following code best describes the situation.  Why is the last line not outputting the trailing newline char?  Each line's output is shown in the comment.  I'm using GNU bash, version 4.1.5 ...
5
votes
1answer
497 views

stdin/stdout names in BASH?

I have a program that takes a -o log_file option, which writes extra data to log_file. Is there any way for me to redirect that to stdout? i.e. is there a "special name" for stdout that can be used ...
5
votes
1answer
2k views

SWF to PDF conversion

Are there any tools for converting SWF to PDF? I have a bunch of SWF files (to be ripped from the web) and I'd like to group them into single PDF.
5
votes
4answers
530 views

Equivalent of forward/back buttons for unix shell (when navigating directories)?

I'd like to be able to type in terminal commands of forward/back especially if I went from a directory with a super-long name to home (and want to return back to the directory with the super-long ...
1
vote
1answer
374 views

Command-line way of send pinging

I have lots of Drupal powered website. Each of the website has Multiping module to pinging ping server. Is there any way of send pinging through command-line? I hope I can build dedicated server for ...
3
votes
1answer
325 views

Conditionally killing a process based on its output

I have a REPL (read-eval-print-loop) for the Clojure programming language listening on a network socket. I can send it code over the network and the code will be evaluated and the answer sent back to ...
9
votes
2answers
570 views

What languages are used to build Unix commands?

Examples of commands I'm referring to are ls, pwd, and cd. Also, how are these built? Do you have an example?
2
votes
1answer
2k views

A more readable ps

Are there any tools that improve the readability of ps in the same spirit as ack for grep? This would be especially on OS X where ps does not even have options such as --sort user. So far the nicest ...
1
vote
2answers
145 views

How to run regular programs as daemons/services [duplicate]

Possible Duplicate: How can I close a terminal without killing the command running in it? I'm using Debian for my Server. I just installed MediaCore, which works well. Now I want to have ...
5
votes
2answers
1k views

Performance difference between stdin and command line argument

For some commands, it is possible to specify certain input as either stdin or a command line argument. Specifically, suppose command can take stdin input and a filename as command line argument, and ...
2
votes
3answers
375 views

When does the order of arguments matter?

In bash, I am not sure if my observation is correct. For most commands, option-like arguments, i.e. arguments that begin with --abc or -a, can be anywhere in the list of arguments to the command, ...
3
votes
1answer
278 views

Could someone please explain some of these escape codes?

I'm seeing this in my .bashrc file: PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\ [\033[01;34m\]\w\[\033[00m\]\$ ' and I have absolutely no idea what all those ...
3
votes
3answers
422 views

Output exceeding terminal window width

I had run a program that resulted in many more lines of output than my current terminal window width. As a result, I could only see partial results...is there any way to get the full output? I am ...
0
votes
1answer
93 views

Ubuntu x86 10.10 terminal

I just downloaded a Ubuntu v10.10 vmware image for Windows. I'm trying to install a web application that can only run on Linux MySQL, Apache and PHP. How do I open a terminal in Ubuntu?
2
votes
1answer
4k views

Play RTMP stream from command-line

I've managed to get flvstreamer to read a radio station's RTMP stream with the options --live -r [url], and it outputs what I guess is the raw audio data + stream info to stdout. Can I make it play ...
4
votes
2answers
176 views

Why do 'man' pages have many extra lines?

When I run the command: man fork There is a highlight line at the bottom that reads: Manual page fork(2) line 52/99 (END) But when I navigate to line 53 and up to 99, these are just blank ...
2
votes
1answer
251 views

Command to monitor elapsed time in background?

I've been trying to find a decent way to monitor elapsed time in the shell. Basically, I'm asking for a stopwatch. The end result is easy enough to accomplish; I've seen examples of using time read, ...
2
votes
3answers
129 views

A command used in another command

For djvused command, there is an option: -e command Cause djvused to execute the commands specified by the option argument commands. It is advisable to surround the djvused commands by ...
1
vote
1answer
439 views

How to resume multiple instances of Screen from command line with minimal steps?

I have about 15 instances of screen running on my linux server. They are each running processes I need to monitor. I had to close terminal (hence the reason I launched screen). Is there a way to ...
17
votes
4answers
15k 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
3answers
435 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 ...
13
votes
2answers
12k views

How to signal the end of stdin input in bash

In Bash, I learned that the ending signal can be changed by here document. But by default how can I signal the end of stdin input? I happened to find that with cat and chardet, their stdin inputs can ...
6
votes
2answers
12k views

How can I verify SSL certificates on the command line?

I'm trying to validate/verify that the rsa key, ca-bundle, and certificate stored here are ok. They are not being served by a webserver. How can I verify them?
1
vote
1answer
187 views

What's the standard used by yum prompt “Is this ok [y/N]:”?

I can see that uppercase letter means default here. Is there a standard for this? I'd like to read the full standards.
2
votes
2answers
266 views

Software (SciTe) runs differently when opened from Terminal Vs GUI

When I open SciTe from the terminal everything works fine. When I open it via Ubuntu 10.04 GUI drop down boxes I get this error every time I try to run a ruby program: sh: ruby: not found At this ...
-3
votes
1answer
341 views

Red hat linux command line character underscore problem [closed]

When I type a command e.g. cd /etc/ I get the following cd /etc$ if I press the backslash key again then I get the correct entry cd /etc/ I am using gnome but I get the same problem ...
2
votes
1answer
7k views

Setenv error message

When I opened up the Gnome command prompt, several lines of the message: No command 'setenv' found, did you mean command 'netenv' from package 'netenv' (command) However, I have never used ...
4
votes
1answer
214 views

Program to filter lines by passing them to an external program?

I'm looking for a program to use an external program to filter the lines of a stream - pretty much a version of grep that, for each line, prints or suppresses it based on whether the specified program ...
7
votes
3answers
1k views

How to install/default to the command line version of Emacs?

I installed Emacs using sudo apt-get install emacs. The problem is that when I launch Emacs from the command line (e.g. emacs main.c) it opens Emacs with a GUI. I prefer the command line version which ...
2
votes
1answer
701 views

Recursively Gziping Files (and keep original files) & Gziping Text Input

I need Gzip to pre-zip some static files for a webserver I'm building. All of the files I need to gzip will be in a folder named .cache. Since some clients may not accept responses that are gzipped, I ...
3
votes
1answer
6k views

Run java classfile from terminal

I have a compiled java file somefile.class, and when i cd into the right folder and do: java somefile it works but when i call it from another folder: java folder/somefile it doesn't work, it gives me ...
7
votes
2answers
1k views

Is there a correct way to list the subdirectories of the current directory?

I can find the subdirectories of a directory by ls -d -- */ or ls -l | grep "^d" but both of these seem indirect, and I would imagine that there would be a standard way to find just the ...
2
votes
3answers
160 views

How to find every file that includes a given function?

I am trying to list all of the files that include a function, e.g., matrixCal. How can I to do this in linux?
1
vote
3answers
2k views

Get line numbers for empty lines

I have a large pipe-delimited file where I need to find the line number of all lines where a certain field is empty. I can use cut -d \| -f 6 filename.txt to output just that column. What is a ...
2
votes
1answer
1k views

CentOS: Alert all desktop users from comand-line

Can someone tell me if there is an way to notify all online (Desktop) users from command-line. I know that if I want that I get notifyed when something is done, I just do like this: sudo apt-get ...
0
votes
1answer
115 views

How to change profile to search current directory?

I would like to change my profile so that I can execute programs in the current directory without ./. In other words: $ foo.sh would accomplish what currently happens with: $ ./foo.sh I'm new ...
2
votes
1answer
460 views

How do I make a droplet/.app in platypus for my unix command?

This is my sample code from the platypus tutorial. I am trying to make it work with a command named pymol, and I want it to open .pdb files or open just pymol. I know nothing about perl, but I have ...
1
vote
1answer
436 views

Need command-line program to download all of http:// https:// scp:// ftp:// style links (on e.g. ubuntu)

I'm writing a perl program where I want to accept all kinds of "file names" from the user, including /home/foo/bar.txt and scp://server/some/file.txt or whatever. And then I thought that if I can find ...
0
votes
0answers
108 views

How to use find command with wildcard when current directory contains a match? [duplicate]

Possible Duplicate: find not recursive when file at top I'm having some confusion with the find command. If I type: find . -name *.xml or find ./ -name *.xml I receive a list of all ...
6
votes
1answer
184 views

Bash executes a different file from the one prompted, even when providing full path

I imagine there's a environment variable or some setting I'm unaware of, but this is driving me nuts. baco:~ # ls -la /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin -rwxr-x--- 1 ...
6
votes
3answers
782 views

Lightweight utility/program to run a command after a random delay

I need to randomize the time before a given command starts. I realize it's relatively trivial to do this within a script, or to write a "wrapper" script to do this, but I'm wondering if anyone knows a ...
2
votes
1answer
271 views

rm command returns a message [1] 12345 What does this mean?

I'm trying to remove a file and I keep getting a message similar to: [1] 12345 and nothing happens, I run a directory search (dir) and the file remains and I get a stopped message