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

learn more… | top users | synonyms (1)

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?
6
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
258 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
467 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
926 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
351 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
903 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
439 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
52k 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
964 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 ...
41
votes
7answers
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
815 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 ...
9
votes
2answers
1k views

Clearing GNU Screen after full-screen application

When working at a normal xterm (not sure about a "real" terminal), when a full-screen program such as man or vim is closed, it disappears, leaving your screen so you can see your prompt, and previous ...
19
votes
5answers
3k views

Why is echo a shell built in command?

$ which echo echo: shell built-in command. $ which ls /bin/ls $ which cat /bin/cat Why is echo not an independent utility like ls, ps, cat etc? Why is it shell specific? Any good reasons?
7
votes
6answers
200 views

Is there any program to provide a consistent interface across multiple archive types?

At the moment, if I download a compressed file, it could be any of a .tar.gz archive, a tar.bz2 arhive, a .zip archive or a .gz archive. And each time I do so, I have to remember what the command line ...
2
votes
2answers
407 views

Is nohup indefinite?

If I run a program with an infinite loop with nohup, will the program run indefinitely (until the machine is reset or until I manually terminate it)?
4
votes
2answers
322 views

Scheduling command/script by specifying the exact second

I'm using bash and wondering how I can execute a command/script at a later specified time, with the accuracy of a second? I read the man page for the at-command, but as far as I could understand it's ...
7
votes
2answers
380 views

Stochastic version of seq for generating sequence of random numbers/words?

Some time ago I used a seq-like tool for printing a sequence of pseudo random generated numbers to stdout. You could specify a range, seed, and the number of samples and much more. I've just ...
16
votes
6answers
2k views

how to glob every hidden file except current and parent directory

I want to glob every hidden file and directory, but not the current (.) and parent directory (..). I am using bash. Observe current behaviour: $ ls -a . .. ...a ...aa ..a ..aa .a .aa .aaa ...
2
votes
1answer
91 views

Testing precedence of resolving addresses from commandline

There was such tool but I cannot remember its name. I needed to configure precedence of addresses by /etc/gai.conf. I finally managed to find an error, but for future, what's the name of tool which ...
16
votes
5answers
13k views

How can I get a count of files in a directory using the command line?

I have a directory with a large number of files. I don't see a ls switch to provide the count. Is there some command line magic to get a count of files?
8
votes
4answers
7k views

grep — removing text after delimiter token

I have a file in which I need to eliminate everything after the first ; on every line. So a file like this: sdfsdsdf; fsdfsddf;sdfsd; Will result in this: sdfsdsdf fsdfsddf I have looked into ...
8
votes
5answers
8k views

Output the common lines (similarities) of two text files (the opposite of diff)?

Diff is a great tool to display the changes between two files. But how to display the similarities of two text files (while ignoring the differences)? I.e. sample input: a: Foo Bar X Hello World 42 ...
10
votes
4answers
13k views

How can I kill a particular thread of a process?

$ ps -e -T | grep myp | grep -v grep 797 797 ? 00:00:00 myp 797 798 ? 00:00:00 myp 797 799 ? 00:00:00 myp 797 800 ? 00:00:00 myp This shows the process ...
2
votes
8answers
2k views

How to give a normal user permission to change root password

Please do not ask why, but is it possible to do it? p/s: I know it's not a good thing, let's just say someone from the top management who is computer illiterate want some sort of control over the ...
3
votes
3answers
717 views

Is there a way to make the prompt definition multiline?

This is my current prompt definition: PS1=$'%F{063}%1~%f %(1v.%F{099}%1v %f.)%F{063}%%%f ' RPROMPT='$VIMODE %m' and I'm working on integrating this. Basically I'm starting to find it very ...
4
votes
2answers
1k views

How to interpret traceroute information?

For example in this pic taken from Wikipedia [Bigger Version] What are all these 12 server names that are listed? I know they are servers that are supposed to be the path that the network packet ...
3
votes
2answers
434 views

How can I apply caret-substitution to my nth-last command?

I regularly find myself having to execute a lengthy command on a file, then process the results with other commands. To process the next file, I usually rerun the same command by hitting the Up key ...
21
votes
7answers
23k views

Do we have an undo in Linux?

I renamed a few files in one batch script. Is there a way to undo the changes without having to rename them back? Does Linux provide some native way of undoing?
2
votes
1answer
2k views

What commands can I use to enable / disable Apache2 modules?

What are the terminal commands used to enable and disable Apache2 modules? Update: Since the commands appear to differ based on distribution, I have made this question a community wiki where ...
11
votes
4answers
6k views

How can I get a formatted date for a UNIX timestamp from the command line

I have a UNIX timestamp and I'd like to get a formatted date (like the output of date) corresponding to that timestamp. My attempts so far: $ date +%s 1282367908 $ date -d 1282367908 date: invalid ...
19
votes
4answers
7k views

Can't pipe into diff?

I wanted to be clever and compare a remote file to a local file without downloading it. I can get the contents of the remote file by ssh user@remote-host "cat path/file.name" However, piping that ...
12
votes
2answers
2k views

Is there a way to intercept interprocess communication in Unix/Linux?

For intercepting/analyzing network traffic, we have a utility called Wireshark. Do we have a similar utility for intercepting all the interprocess communication between any two processes in ...
14
votes
5answers
29k views

Is there a way to see details of all the threads that a process has in Linux?

For Windows, I think Process Explorer shows you all the threads under a process. Is there a similar command line utility for Linux that can show me details about all the threads a particular process ...