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

learn more… | top users | synonyms (1)

15
votes
4answers
4k views

Why do some commands 'hang' the terminal until they've finished?

Sometimes you run a program from the terminal, say, lxpanel†. The terminal won't drop you back to the prompt, it'll hang. You can press Ctrl+C to get back to the prompt, but that will kill ...
13
votes
3answers
1k views

How can I keep control+d from disconnecting my session?

I regularly ssh to a centos 5 box. Somehow they keys are mapped so that control+d will log me out of my current shell. If I am sudo'ed to another use it puts me back to the previous user. If I am not ...
39
votes
8answers
27k views

How can I edit multiple files in VIM?

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
3
votes
1answer
290 views

How to use SCSUDO to run scripts with positional parameters?

I am trying to use scsudo to run a number of defined commands to stop and start processes on a UNIX host. The issue I am experiencing is that scsudo does not seem to like the use of positional ...
2
votes
1answer
169 views

ide and pci bus commands

Is the ide interface also a bus? Is there a command like lspci or lsusb, to find out what devices are on the ide bus? Sources seem to contradict eachother. I'm asking this question here because of the ...
2
votes
3answers
114 views

Filter --help command?

Sometimes I want to search/filter help for particular commands for keywords. history --help gives list of options, sometimes it's overwhelming how much info is there. Can I filter it for keywork ...
1
vote
1answer
165 views

How to create and edit a text file from the bash shell

I am logged into a linux server via ssh. From the bash shell, is there any standard way of bringing up some kind of text editing environment so I can create and edit a text file? I am aware that there ...
4
votes
1answer
236 views

Why did using xargs fail in this case?

I tried to understand the usage of xargs and did the following experiment. ls | xargs | touch I want to refresh the files dates and directoris in the curent directory. Though it is a bit silly,for ...
1
vote
1answer
263 views

How to know if a Linux command can read from STDIN?

I noticed this problem when I became confused with pipe, one command send its executing output to the STDOUT, which is the STDIN for the other command, which can read from STDIN. How do I know if a ...
1
vote
1answer
549 views

How to make festival evaulate its own scheme expressions from the command line, so as to change voices as needed?

I can't seem to find any documentation on this. This forum post shows someone trying to change the voice used by festival, outside of the festival interpreter, using a command-line flag. festival ...
2
votes
2answers
2k views

Passing values through pipes

I don't quite understand pipes in Linux command line. I noticed that: ll - R | grep *.pdf will list files ending with .pdf But locate *.pdf | du -h will not calculate the size of files ...
4
votes
2answers
1k views

What command line tools are available for testing Web Service? [duplicate]

Possible Duplicate: Does anybody here have experience in automating some tasks in web applications using curl? There are a number of GUI based tools to test Web Service (e.g. soapUI) Is ...
3
votes
2answers
91 views

Output the changes to a log file

If I use tail -f *filename* I get a real nice display of whatever is changing in a given file. However, sometimes I want to be able to search this text or otherwise look it over slowly. Is ...
2
votes
4answers
988 views

Access the last file (alphabetically) in a directory

I'm trying to open a file with vim from the command line, the file is in a directory filled with automatically generated files that are prepended with a time stamp. Since I don't know the time stamps ...
2
votes
3answers
264 views

Stuck between these two books? [closed]

I'm new to Unix/Linux platforms so I was hunting for good books on *nix... I soon realized there is not one book or resource. But to gain confidence on the command line and scripting (the real *nix ...
3
votes
0answers
64 views

Use command line to download file which is accessible only in a given session [duplicate]

Possible Duplicate: Does anybody here have experience in automating some tasks in web applications using curl? Sorry for the lengthy title. I am trying use command line to download a ...
3
votes
1answer
485 views

How can I copy all users .bash_history files into my home directory?

I am running as root. I want to copy all the users on the system's .bash_history files into my home directory. I can do this to combine all of them into one, but then I can't tell who's commands are ...
7
votes
1answer
2k views

List of modified files of the past 24 hours

Is there a reliable way to have a system that mails me the list of files that were modified in the past 24 hours inside a set of directories? (like /home/*/public_html/* and /home/*/*domains/*)
2
votes
1answer
263 views

Extract pitch information from audio file

Is there a command-line utility which would allow me to extract pitch information from an audio file and store it in a numerical form (i.e. as a list of comma-separated values)?
9
votes
11answers
9k views

How can I “cat” a file and remove commented lines?

I'd like to know if there is a way that I could cat file like php.ini and remove all lines starting with ; For example, if the file contained this: ; - Show all errors, except for notices ; ...
2
votes
1answer
72 views

App which can execute arbitrary code on different events

I've been looking for a simple activator which can execute some code when stuff happens, I haven't found anything yet. Maybe, I am not using the right keywords. It would be great if someone pointed me ...
9
votes
1answer
3k views

How do I enable locate and queue the database to be built?

On a new Ubuntu 10.4 instance, I tried to use the locate command only to receive the error locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory from using this command ...
4
votes
3answers
599 views

How to create a bounded queue for shell tasks?

I have 1000 gzipped files which I want to sort. Doing this sequentially, the procedure looks pretty straightforward: find . -name *.gz -exec zcat {} | sort > {}.txt \; Not sure that the code ...
6
votes
6answers
298 views

Searching in many files

Is there some sophisticated technique to search strings in many files? I tried this basic technique for i in `find .`; do grep searched_string "$i"; done; It doesn't look much sophisticated and ...
5
votes
2answers
2k views

Is there a unix command line tool that can analyze font files?

Given a directory of font files (TTF and OTF) I'd like to inspect each font and determine what style (regular, italic, bold, bold-italic) it is. Is there a command line tool for unix flavored ...
3
votes
1answer
195 views

Restricting access to files on an external drive

I was wondering how to restrict access to a specific drive in Unix on the Mac. I was thinking to do this in Terminal where I create a file like this mkfile 6k secure_access. And where secure_access ...
7
votes
4answers
5k views

How can I run a specific command for each find result?

How would one run a specific command for each file that was found by using the find command? For the purpose of the question lets say that I would simply like to delete each file found by find. I am ...
11
votes
3answers
3k views

How can I pipe output to another process, but retain the error state of the first process? [duplicate]

Possible Duplicate: Get exit code of process that's piped to another I am using the following command line (in a makefile) to pipe the verbose error messages from my compiler through a ...
-1
votes
2answers
3k views

clear tmpfs in my case

I am on a Ubuntu machine. I have make a directory under root directory, by: $ sudo mkdir /hello $ sudo mkdir /hello/bye Then I mount tmpfs with size 1024M to /hello/bye by: $ sudo echo "tmpfs ...
1
vote
3answers
146 views

Transferring access privileges from root to regular user

I log in to Ubuntu with the username student. There are some directories only the root user is allowed to access, for example /var/lib/mysql, (I know I can use sudo to access it but it is not what I ...
0
votes
1answer
7k views

Different ways of using expr command [closed]

I'm trying to learn the bash expr command inside and out. What are some of the most basic to the most creative/tricky/unexpected ways to use the expr command? Small, manageable examples are great.
1
vote
3answers
4k views

how to find out the ip of an ssh HostName

Is there a simple way to retrieve the IP of a HostName from an ssh config on the command line? Many times I have to use scp and would like to connect to a machine, but I remember only the HostName.
5
votes
2answers
5k views

Looking for a Java class in a set of JARs with find, unzip, grep

I was trying to find the JAR containing a Java Class. JARs are in zip format. My first attempt was: $ find -name "*3.0.6.RELEASE.jar" | xargs -l1 unzip -l \ | grep stereotype.Controller ...
1
vote
1answer
244 views

Empty typescript file with the script command

In the command line, I typed: script -a myfile Then, I typed the some standard commands. When I opened the myfile using vi, the file was empty. Why is that? And, also, any tips on using the ttyrec ...
8
votes
4answers
807 views

How can I get the most bang for my buck with the “diff” command?

I have tried using the linux diff command in the past without much luck or patience. I usually end up using a GUI utility like DiffMerge or Kdiff. Recently I started trying to use diff again to ...
1
vote
2answers
854 views

How can I make bash more readable? [closed]

As a linux user, I spend a lot of time mucking about in bash. I've always been a bit frustrated by how poor the readability is. Today this annoyed me enough to spur me into action. My immediate ...
7
votes
4answers
478 views

Capturing area of the screen without a Desktop Environment?

I'm running OpenSuse with dwm as a window manager. Since I made the switch from KDE, I haven't found a way to take a screenshot or even capture part of my screen. Is there a way I can do this in a ...
51
votes
6answers
6k views

When is xargs needed?

The xargs command always confuses me. Is there a general rule that can help me figure out when I need it? Consider the two examples below: $ \ls | grep Cases | less prints the files that match ...
1
vote
1answer
503 views

Create recovery medium from Windows 7 recovery partition

Many laptops are delivered with Windows 7 recovery partition (but without CD or DVD) which takes place on the harddrive that could contain some Linux distribution or serve for data storage. I don't ...
14
votes
2answers
4k views

How to execute consecutive commands from history?

Suppose I want to execute a sequence of four commands that I have executed before. If the first one is 432 in the command-history, then I could do: $ !432; !433; !434; !435 I'm curious, is there a ...
2
votes
2answers
10k views

Finding files containing certain strings under a directory [duplicate]

Possible Duplicate: How do I find text within a file and have it search multiple subfolders? I would like to find out all the files under mydir/ directory whose content contains the string ...
15
votes
4answers
19k views

What's the best way to join files again after splitting them?

If I have a large file and need to split it into 100 megabyte chunks I will do split -b 100m myImage.iso That usually give me something like xaa xab xac xad And to get them back together I have ...
2
votes
1answer
853 views

Changing gnome terminal transparency with a command in Ubuntu?

How can I change the transparency of the Terminal windows in Ubuntu with a command? I already know about the profile method but want a command so that I can quickly swap between transparent and ...
46
votes
3answers
2k views

Why is `--human-readable` needed and not default?

Several command line tools use the -h or --human-readable option to print file size in a human readable format (i.e., 36G vs 37550836). Why is this option needed and not the default? Aren't these ...
2
votes
2answers
813 views

How do I connect to a new wifi on the command line? [duplicate]

Possible Duplicate: All commands that should be used to connect to wifi in command line I don't need to configure my wifi card or anything. I just want to do the equivalent of a) listing ...
3
votes
4answers
1k views

Why can't I echo the password to fetchmail?

I'm trying to configure a fetchmail. Before I deal with the syntax of fetchmailrc ( I discovered that the level of bugginess of a problem is synergistic with the number of different aspects of the ...
2
votes
0answers
721 views

What good are the signs '-' (minus) in any Linux/UNIX commands? [duplicate]

Possible Duplicate: What does “--” (double-dash) mean? Single dashes - for single-character options, but double dashes -- for words? I was reading the man zip page and I found ...
19
votes
5answers
5k views

Command line friendly spreadsheets

Does such a thing exist? Text-based spreadsheets that display well in a CLI environment. I'm aware that I could cat foobar.csvand do as I please, but it isn't particularly practical or attractive. I ...
9
votes
3answers
701 views

How to pipe the list of commands displayed by of “tab complete”?

When using commands in bash I like the double tab option to display the available commands. Some commands have more possible matches than others: Is there a way I can pipe the output of the double ...
3
votes
2answers
840 views

Move with possible rename

Is it possible to construct a command that will move the file to another directory and if the same file is already there, generate some random string that is not in the name of some file in the ...