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

learn more… | top users | synonyms (1)

31
votes
7answers
5k 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?
7
votes
2answers
345 views

Command-line software for playlist syncing to Android Phone?

I'm looking for a way to sync music to my Android Phone without having to load something like banshee. I know there are plenty of ways to sync files, but I'm interested in syncing playlists and having ...
13
votes
7answers
7k views

diff within a line

I have some sql dumps that I am looking at the differences between. diff can obviously show me the difference between two lines, but I'm driving myself nuts trying to find which values in the long ...
1
vote
5answers
219 views

What horrible mistakes should I avoid as a newb? [closed]

Edit - please see this duplicate question. I just chowned -R my /usr folder, which totally corrupted my computer (not sure how, but I lost sudo power eventually). This seems like a horrible newb ...
3
votes
1answer
364 views

Multiple renaming files [duplicate]

Possible Duplicate: How to clean up file extensions? I'd like to rename files with extension .flac.mp3 to extension .mp3. I used the following command $ for i in *; do mv $i `echo $i | sed ...
3
votes
2answers
603 views

How do I execute a script later?

I need to compile gcc45 on my computer and that's a lengthy and resource-intensive process for my computer, so I'd prefer to have it do it while I sleep (at night). What's the closest thing to: $ ...
3
votes
1answer
225 views

ssh behavior for root and non-root user

When I ssh as root to a remote machine, the command output looks like this: root@Machine:/current/path#: However, if it's a non-root user, all I see is: $ How can I get the same behavior as for ...
8
votes
6answers
9k views

How do I install a PHP CLI with a usable interactive prompt on Debian Wheezy?

When I install php5-cli on Debian Wheezy (currently testing), the interactive prompt is very unusable due to missing readline support (bug 341868). What's the easiest way to install a version linked ...
23
votes
6answers
26k views

Where do files go when the rm command is issued?

Recently I accidentally did rm on a set of files and it got me thinking where exactly these files end up? That is to say, when working with a GUI, deleted files go to the Trash. What's the equivalent ...
7
votes
2answers
3k views

Reading from a continuously changing logfile [duplicate]

There is /location/of/thefile, which is a continuously changing logfile. The average density of refreshes is 4 per minute, the possible maximal refresh rate could be 30-40 per minute. Every refresh ...
55
votes
9answers
2k views

Remember a half-typed command while I check something

I often find myself in the following position: I've started typing a long command at the bash prompt, but half-way through I find out I need to check something with another command. This is a problem ...
12
votes
2answers
2k views

Where do my ANSI escape codes go when I pipe to another process? Can I keep them?

I sometime want to pipe the color-coded output fror a process, eg. grep... but when I pipe it to another process, eg. sed, the color codes are lost... Is the some way to keep thes codes intact ? ...
3
votes
2answers
398 views

Change the time format for the touch command in BSD

I am wondering how to change the time format when I am modifying a time with the touch command in the c shell. For example I need to use touch -a -t 051512002015 file.txt This will change the ...
24
votes
4answers
15k views

What is the mknod command used for?

I just started using Ubuntu as my main OS and I wanted to learn about things I should not do, and learn by the bad things people have done in the past. I came across these email about horror stories ...
3
votes
4answers
1k views

How to get size of a block special file?

I need to be able to determine the size of a block special file. For example, given /dev/sda, I need a command that will provide the size of the device. (By size I mean capacity, since this is a ...
3
votes
2answers
592 views

Oneliner for slicing an image?

I'm looking for a oneliner command that would slice an image into given proportions. Say input would be filename and slice dimensions. Are there any standard command-line tools for this? I tried ...
3
votes
0answers
168 views

How to copy a long textfile to clipboard on gnome-terminal? [duplicate]

Possible Duplicate: How do I send stdin to the clipboard? What's the best way to copy a long text file to keyboard? I'm imagining something like: cat longTextFile | straightToClipboard
2
votes
0answers
149 views

Execute command when file changes [duplicate]

Possible Duplicate: Can a bash script be hooked to a file? Hi there, I am trying to execute a command every time a file changes. Is this possible? I think there is some way to watch for a ...
1
vote
3answers
444 views

Cannot access network on the command line in Ubuntu 10.04

I am having an issue which I am unable to diagnose. I am unable to access outside the local network from the command line. Strangely, ftp works from the command line. But ping, links, traceroute, wget ...
21
votes
8answers
7k views

How do I split a flac with a cue?

I've got a full album flac, and a cue file for it. How can I split this into a flac per track. I'm a KDE user, so I would prefer a KDE/QT way, I would like to see command line and other gui answer's ...
-1
votes
2answers
258 views

CentOS command issue

This is what I am trying to run in VMware using CentOS 5 /pwnat: invalid option -- p usage: ./pwnat <-s | -c> <args> -c client mode (default) <args>: [local ip] ...
5
votes
2answers
3k views

What params do I pass to grep to return only file names?

I'm trying to use grep to find a specific piece of text in a bunch of files on my web server. No problem, except that it returns way more information than I want! Ideally it would just return a list ...
5
votes
1answer
1k views

How can I clear the list of recently accessed documents in Fedora?

When I click on the Clear recent documents item in the GNOME menu, it clears the list of recently used documents (as expected). How can I replicate this functionality from the command line?
2
votes
1answer
659 views

Can I redirect stdout from a background application after starting it? [duplicate]

Possible Duplicate: redirect output of a running program to /dev/null Is it possible to change stdout after starting something as a background application in the command line? Say I run ...
2
votes
3answers
3k views

Printing unique lines

Is there some better solution for printing unique lines other than a combination of sort and uniq?
32
votes
6answers
55k views

How to overwrite target files with mv?

I have a ton of files and dirs in a subdirectory I want to move to the parent directory. There are already some files and dirs in the target directory which need to be overwritten. Files that are only ...
5
votes
3answers
5k views

How to cd to a Windows file share?

At work, I spend a lot of time manipulating files on a networked computer that's running SME Server (but that's set up for Windows filesharing, if that somehow makes a difference). I have been ...
3
votes
2answers
351 views

Drawing a state machine from logs

I have logs in the following format: 03/22/2011 14:45:06;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35707.arien.ics.muni.cz state from EXITING-RETURNSTD to EXITING-STAGEOUT (5-51) ...
6
votes
4answers
5k views

All commands that should be used to connect to wifi in command line

I would like to switch from gnome to awesome and I would like to connect my wifi network in command line (instead of using gnome tools). So, I searched on the internet and found approximatively the ...
2
votes
3answers
526 views

Selective recursive move?

Is there a command like mv --preserve-structure src src/1 src/2/3 dst which creates dst/1 and dst/2/3? It should work similar to mv src/* dst, but move only the subtrees listed.
9
votes
2answers
963 views

What does “-” mean as an argument to a command?

I found this link on how to open tgz in one step. gzip -dc target.tar.gz | tar xf - What does the '-' mean?
4
votes
5answers
4k views

How can I logout from a graphical environment from the command line?

Part of the beauty of trying out alpha releases of operating systems is that things will break, including things we take for granted. Today it's the turn of the logout button. So, how do you log out ...
7
votes
1answer
342 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 ...
3
votes
1answer
2k views

xmessage over ssh

The following command prints a message over ssh : xmessage Message -display :0 & How does it work? there is no -display option in xmessage's man page.
5
votes
2answers
1k views

Script for opening a file in an already existing emacs process

I keep emacs open all the time I'm working. I have several script that will launch all the apps and files related to a specific project. But, it will launch emacs again, rather than simply cause the ...
10
votes
4answers
16k views

What program do I use to check mail?

I'm receiving "You have mail" messages and according to How to remove “You have mail” welcome message I should read my mail with mail. However I cannot find the command in my system (Ubuntu 10.04 ...
27
votes
4answers
2k views

Is there a one-liner that allows me to create a directory and move into it at the same time?

I find myself repeating a lot of: mkdir longtitleproject cd longtitleproject Is there a way of doing it in one line without repeating the directory name? I'm on bash here.
29
votes
10answers
11k views

How do I reuse the last output from the command line?

This is a noob question, but I'd like to know how to reuse the last output from the console, ie: pv-3:method Xavier$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" ...
18
votes
1answer
1k views

Should the usage message go to stderr or stdout?

Should the usage message which is printed with e.g. command -? of a Unix command go to stderr or stdout, and why? Should it go to the same place if the user makes a mistake with an option?
6
votes
3answers
13k views

Getting all files that have been modified on a specific date

Is it possible to find all php files within a certain directory that have been modified on a certain date I'm using find /var/www/html/dir/ -mtime -28 | grep '\.php' to get files modified within ...
34
votes
3answers
12k views

What is the difference between Halt and Shutdown commands?

What is the difference between the halt and shutdown commands?
0
votes
3answers
4k views

Why $JAVA_HOME does not persist on a mac?

On my mac os 10.6.6 I'm trying to persist env variable $JAVA_HOME but it doesn't stick! $ export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Once I restart it won't ...
4
votes
2answers
303 views

Relaunch application once finished

Is there a command that relaunch the application once it finishes from the command line? Letting you do something like: > relaunch python myapp.py If not, then what's my best option? I know I ...
2
votes
2answers
4k views

Converting text into ASCII/ISO-8859-1

I'm looking for some tool that can convert text, ideally from UTF-8 (but ISO-8859-2 and WINDOWS-1250 would be fine) into ASCII/ISO-8859-1? I have seen some online transliteration tools but I need ...
87
votes
13answers
32k views

How to have tail -f show colored output

I'd like to be able to tail the output of a server log file that has messages like: INFO SEVERE etc, and if it's SEVERE, show the line in red; if it's INFO, in green. What kind of alias can I ...
19
votes
3answers
811 views

Can other users view the arguments passed to a command?

If I invoke a command with arguments like so: bob@bob-pc:~$ command -arg1 -arg2 ...can other users view the arguments passed to the command?
3
votes
2answers
3k views

su vs su - (on Debian): why is PATH the same?

I know what should be the difference between su and su -, but in my system (debian testing) for example PATH is the same: [root]# su [root]# echo $PATH ...
8
votes
6answers
6k views

date, get current 15 minute interval

Is there any way I can get the current 15 minute interval using the date command or similar ? e.g. something like date %Y.%m.%d %H:%M will give me 2011.02.22 10:19 , I need something that yields ...
4
votes
3answers
451 views

Unix command that takes no arguments

Don't ask why, but is there a Unix command that takes no arguments?
8
votes
4answers
3k views

command to layout tab separated list nicely

Sometimes, I'm getting as an input tab separated list, which is not quite aligned, for instance var1 var2 var3 var_with_long_name_which_ruins_alignment var2 var3 Is there an easy way to render ...