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

learn more… | top users | synonyms (1)

20
votes
3answers
11k views

How does the “tail” command's “-f” parameter work?

$ tail -f testfile the command is supposed to show the latest entries in the specified file, in real-time right? But that's not happening. Please correct me, if what I intend it to do is wrong... I ...
5
votes
2answers
79 views

Handling an option-like filename in the shell [duplicate]

Possible Duplicate: How do I delete a file whose name begins with "--"? Due to mismatched switches when I was trying to run a command, I have a log file named -w in a directory. I ...
4
votes
3answers
445 views

GNU: Delayed jobs Queue

Is there a simple way for me to add a shell command to a list of jobs to have run on the system when I'm not logged in? For example: I SSH into my system, decide that I want to read an ebook later, ...
3
votes
1answer
516 views

Keyboard input not displayed on the screen?

We use the `exceed tool to connect to our UNIX servers, but sometimes the command-line behaves erratically. When I am typing some command on the command-line, nothing happens -- nothing is displayed ...
3
votes
1answer
3k views

command line tool to set time zone

In Centos 5.x there is the text mode interface of system-config-date to set the time zone. Although that utility still exists in Centos 6 the text mode is gone. Is there anything similar in Centos 6?
4
votes
1answer
806 views

Is there a tool in linux that allows multi-line regex expressions?

I'm wanting to find the results of a multi-line regular expression in linux. I tried grep, but like most linux utilities it's line based. Is there something similar that allows me to search across ...
25
votes
3answers
9k views

How can I “relink” a lot of broken symlinks?

I have a directory tree which has a bunch of symbolic links to files under /home... however, I have moved /home to /mnt/home and need a way to "relink" all of the symlinks. Does such functionality ...
1
vote
1answer
129 views

How can I display file info of a man?

I know when you are in a man page it will display the file name at the bottom inside the man. How can I do the same thing manually?
8
votes
1answer
1k views

How to run my own program without specifying its path

Let's suppose I have compiled something and I run it like so: $ /path/to/my/executable/mycmd Hello World What do I need to do to run it like $ mycmd Hello World from everywhere in my computer? ...
4
votes
1answer
1k views

How do I add ncmpcpp search results to the current playlist?

Using the ncmpcpp MPD client, in the search function (F4) how can I add all the search results to the current playlist short of adding each item one-by-one? For example, say I search for all music ...
2
votes
1answer
305 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
3k 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
886 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
825 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
6k 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
556 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
539 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
546 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
379 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
332 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
572 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
148 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
394 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
434 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
179 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
255 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
130 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
447 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
16k 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
443 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 ...
14
votes
2answers
13k 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
13k 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
189 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
277 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
353 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
220 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
712 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 ...