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

learn more… | top users | synonyms (1)

5
votes
1answer
892 views

How to get a persistent “history”-file even after a non-clean shutdown?

I am trying Ubuntu Server 10.10 in VirtualBox. I like that the commands I run is saved in a "history"-file that can be shown with the history command. But if I just turn off VirtualBox without the ...
3
votes
1answer
988 views

Montage together five gifs

I have five gifs all with the same number of frames and the same framerate. Is it possible to montage these together into one gif where each frame is similar to a normal montage of static images and ...
6
votes
6answers
510 views

How can I reproduce commands run on one machine on another machine?

I would like to install some software on a linux-machine that I have run in VirtualBox. Then I would like to do the same thing on a linux-VPS. I think that I can save all commands that I run using ...
11
votes
7answers
9k views

grep and tail -f?

Is it possible to do a tail -f (or similar) on a file, and grep it at the same time? I wouldn't mind other commands just looking for that kind of behavior.
1
vote
1answer
1k views

What strings should I look for in /var/log/auth.log?

I wrote a bash command to scan /var/log/auth.log for messages occurring on the current day indicating unauthorised access. Currently it just fetches messages matching BREAK-IN and unauthorized. What ...
6
votes
5answers
8k views

how do I add newlines between lines printed on the command line?

Mail logs are incredibly difficult to read... how could I ouput a blank line between each line printed on the command line. For example say, i'm grep-ing the log. That way multiple wrapped lines ...
17
votes
7answers
3k views

Command-line-friendly full-text indexing?

Is there such a thing as a full-text indexing engine, that can be queried from the command line and ideally wouldn't require using a gui at all ? I'm especially interested in indexing my ebooks and ...
10
votes
2answers
10k views

What does ^d mean in ls -l | grep ^d?

When I do ls -l | grep ^d it lists only directories in the current directory. What I'd like to know is what does the caret ^ in ^d mean?
23
votes
4answers
4k views

How to echo a bang!

I tried to create a script by echo'ing the contents into a file, instead of opening it with a editor echo -e "#!/bin/bash \n /usr/bin/command args" > .scripts/command The output: bash: ...
5
votes
1answer
448 views

How to use the ul command line utility

I wanted to answer http://unix.stackexchange.com/questions/3043/use-roff-to-underline-words with "just use ul, this command is meant specifically for underlining text", however I just can't grasp how ...
1
vote
2answers
749 views

How can I shutdown after unmounting a USB device from the command line?

Previously, I asked this question about how to suspend Linux after a set amount of time. I would like to ask a similar question. Supposing I have a USB device attached to my system (OS = Fedora 13), ...
18
votes
5answers
18k views

How do I convert an epoch timestamp to a human readable format on the cli?

How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome).
4
votes
2answers
3k views

Is there a way to empty the trash/wastebasket from the command line?

This would be great especially considering the latest version of Ubuntu is very slow when displaying directories on my PC...
12
votes
3answers
3k views

Sunrise and other astronomical data from the command line

Is there a simple open-source, command-line program that can show the sunrise and sunset times at a given date and location, and perhaps moon and planet data as well? Browsing the Debian package ...
6
votes
1answer
3k views

Show a notification across all running X displays

Using the command line, I'd like show a notification on every running X display. ( and running console ) Something like: notify-send-all 'Warning' 'Nuclear launch in 5 minutes, please evacuate' Is ...
20
votes
1answer
14k views

What is the difference between modify and change in stat command context?

The stat command's manual page says: %x Time of last access %y Time of last modification %z Time of last change I am unable to understand what is the difference between ...
20
votes
4answers
13k views

How to redirect output of wget as input to unzip?

I have to download a file from this link. The file download is a zip file which I will have to unzip in the current folder. Normally, I would download it first, then run the unzip command. $ wget ...
6
votes
2answers
2k views

Getting and setting screen size for Xorg

I would like to run a command like get-screen-resolution during a X session to get a '800x480' output. ( or whatever the actual screen size is ). Is there something available for this? Currently I ...
6
votes
1answer
476 views

Difference between references of Linux “utilities”, “commands” and “programs”

I read uses of the word "utilities" for commands/programs such as 'ls', 'chmod', 'mv', etc. Is "commands" is Linux referring to the same things as top, ps, etc., or are those something different? ...
8
votes
3answers
618 views

how to queue a command to run after another command finishes?

Sometimes I start a program that takes a very long time to finish (emerge), then realize that I should go to bed instead of waiting for it. If I know this in the first place I would run program; halt ...
2
votes
5answers
2k views

how to pass the result of `find` as a list of files?

The situation is, I have an MP3 player mpg321 that accepts a list of files as argument. I keep my music in a directory named "music", in which there are a few more directories. I just want to play all ...
41
votes
6answers
15k views

How can I move files and view the progress (e.g. with a progress bar)?

When moving large directories using mv, is there a way to view the progress (%)? The cp command on gentoo had a -g switch that showed the progress.
6
votes
3answers
1k views

Command line join of password protected wireless networks in Ubuntu, Arch Linux, or other distros?

Is there a way to join a password protected wireless network via the command line in installations of Ubuntu or Arch Linux with no desktop environment or any GUI installed? Also, could this be done ...
7
votes
2answers
3k views

How do I merge two *.srt files

Please see this question. I have just merged two avi files cd1.avi and cd1.avi into movie.avi using: avimerge -o movie.avi -i cd{1,2}.avi Problem is that I had to subtitle files linked to the ...
11
votes
3answers
14k views

How do I put a hat on 'e' (ê)?

Since I've migrated to linux a few years ago, one issue still remains. The ê character features a lot in my "moeder taal" (home language). In Windows making the character was easy, I simply had to ...
11
votes
4answers
6k views

How do I merge two *.avi files into one

I have two *.avi files: sequence1.avi sequence2.avi How do I merge these two files using a command-line or GUI?
7
votes
3answers
13k views

How do I count the number of occurrences of a word in a text file with the command line?

I have a large JSON file that is on one line, and I want to use the command line to be able to count the number of occurrences of a word in the file. How can I do that?
10
votes
3answers
6k views

copy recursively except hidden directory

How do I copy recursively like cp -rf *, but excluding hidden directories (directories starting with .) and their contents?
2
votes
1answer
261 views

How to save temp data

updated: I'd like to save a large amount data ( ~ 100MB ) from the standard input in temporary location for the duration of my bash session. Piping it to a file won't work as I have only 30MB of ...
5
votes
2answers
1k views

How to suspend and resume processes

In the bash terminal I can hit Control+Z to suspend any running process... then I can type fg to resume the process. Is it possible to suspend a process if I only have it's PID? And if so, what ...
8
votes
5answers
472 views

What's the best way to take a segment out of a text file?

What's a good way of extracting say, lines 20 -45 out of a huge text file. Non-interactively of course!
7
votes
2answers
932 views

grep - why do brackets in grep pattern remove the grep process from ps results?

Why do brackets in a grep pattern remove the grep process from ps results? $ ps -ef | grep XXXX [...] XXXX [...] grep XXXX $ ps -ef | grep [X]XXX [...] XXXX
3
votes
3answers
353 views

Quoting commands

As I've learned to use Linux over the years, I've repeatedly come across the idiom of quoting commands with a leading backtick (`) and a following single quote ('), like so: `rm -rf /tmp/foo/bar' (I ...
1
vote
3answers
918 views

Commandline gstreamer player

Is there a good, simple commandline player that uses gstreamer?
6
votes
1answer
3k views

Command-line mv exclusion list

Is there a way to mv,cp, or any file operation such that I could specify all the files I don't want affected? For example, say I have a folder with the files file1, file2, and file3, and I want to ...
6
votes
4answers
440 views

Scheduling commands by system inactivity

So cron or at can schedule our commands to run at the exact time we need them to, but can we schedule commands to run when systems are inactive? Something like: echo "some_commands" | when 'cpu ...
4
votes
1answer
2k views

Enabling or disabling one monitor in nVidia Twinview on the command line, like with nvidia-settings

For some reasons, most native games as well as Wine have a problem with Twinview. So when starting SC2 I have to manually disable one of my two screens in nvidia-settings. (By going in X Server ...
25
votes
7answers
54k views

How do I make my pc speaker beep

Using bash, how can I make the pc speaker beep? Something like echo 'beepsound' > /dev/pcspkr would be nice.
0
votes
2answers
2k views

Unix - Filter Commands

I want to know about the "filter-command" which are available in Unix. I am confused regarding this: What is the purpose of "Filter-Command" ? Which are the Filter-commands available in Unix? I ...
2
votes
2answers
2k views

Fedora auto suspend

I am using Fedora 13 and for shutting down and rebooting automatically, we have the following commands: # shutdown -h/-r now Similarly, if I want to make my system go into suspend mode after ...
9
votes
2answers
3k views

When do su and sudo use different passwords?

I am able to run anything using sudo; my password is accepted. But whenever I try to do su from a shell, it fails with: su: incorrect password What can the problem be?
5
votes
4answers
981 views

recursively chmod

I was trying to chmod folders and files with: find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; But I was wondering: How to do it in one line using find and excluding the ...
16
votes
3answers
17k views

How can I use ffmpeg to split MPEG video into 10 minute chunks for YouTube upload?

There is often a need in the open source or active developer community to publish large video segments online. (Meet-up videos, campouts, tech talks...) Being that I am a developer and not a ...
12
votes
3answers
4k views

Break a large file into smaller pieces

How do I break a large, +4GB file into smaller files of about 500MB each. And how do I re-assemble them again to get the original file?
10
votes
1answer
6k views

Meaning of root:wheel

What does root:wheel mean in the following? chown root:wheel myfile
8
votes
3answers
8k views

How can I move files by type recursively from a directory and its sub-directories to another directory?

What would be a good way to move a file type from a directory and all of its sub-directories? Like "move all *.ogg in /thisdir recursively to /somedir". I tried a couple of things; my best effort was ...
44
votes
8answers
7k views

How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?

How do you remove a file whose filename begins with a dash (hyphen or minus) -? I'm ssh'd into a remote OSX server and I have this file in my directory: tohru:~ $ ls -l total 8 -rw-r--r-- 1 me ...
3
votes
1answer
834 views

CLI interace to KDE's notifier

I think KDE's notifier is pretty sweet. I was thinking... how useful might it be if my system logs were also sent there, so they would pop so I could see them. I think the first step of this is to ...
3
votes
1answer
2k views

What does 'patch unexpectedly ends in middle of line' mean?

This is the output of my patch command: Hunk #11 merged at 4184,4190. Hunk #12 merged at 4444. Hunk #13 merged at 4944. Hunk #14 NOT MERGED at 5106-5116. Hunk #15 merged at 5290. Hunk #16 merged at ...
5
votes
4answers
3k views

Passing an argument to multiple commands in a single line

I'd like to be able to run multiple commands on the same file in a single line. The way I currently do this is: commandA file && commandB file && perl -ne '...' file My gut instinct ...