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

learn more… | top users | synonyms (1)

7
votes
1answer
15k views

Using --exclude with the du command

This is probably something basic but I'm not able to make it work. I'm trying to use DU to get a total size of files minus certain directories. I need to exclude one specific directory called uploads ...
2
votes
1answer
12k views

How to start nvidia x server settings from command line?

I am using Ubuntu 10.04, I know I can start NVIDIA x server settings by choose : System -> Preference -> Monitors on the top bar. But how can I start the NVIDIA x server settings window by run a ...
10
votes
5answers
1k views

Why does mkdir not have the -p flag set by default to allow for nested directory creation?

I see no reason why the -p flag on mkdir should not be set by default. -p, --parents no error if existing, make parent directories as needed It is a non-destructive command from what I can ...
4
votes
2answers
1k views

How to install light-weight vim and to be able to efficiently load files into one instance vim?

On my laptop with Ubuntu I'm able to have just one instance of vim, launched with vim --servername VIM After this I'm able to open files from console with vim --remote-silent filename I use ...
1
vote
1answer
182 views

How do I change the path used by the Gnome Command Line applet?

For my shell, I know that I have to modify .bashrc to add my ~/bin directory to the command path, but how do I get the Gnome Command Line applet to use that as a program location too? I'm using ...
4
votes
3answers
18k views

How can I embed subtitles into videos with ffmpeg?

I'm told it's possible to embed subtitles (.srt) into video files (.avi) using ffmpeg, but I can't find any mention of it in the man page. Is this possible? What command do I use?
6
votes
2answers
3k views

diff where lines are mostly the same but out of order?

I want to diff two sets of mod_rewrite rules. The set of lines are about 90% identical, but the order is so different that diff basically says they are completely different. How can I see which lines ...
2
votes
1answer
440 views

There is no bash indicator prompt after a forked process terminates

I am reading the book Advanced Programming in the Unix Environment. There is a test program to test the fork function. It works well in my Ubuntu. But what I confused is that why there is no command ...
0
votes
1answer
2k views

How to use bash control a keyboard

How to use bash command control a Keyboard. e.g. what is a command in bash for pressing ctrl+c, ctrl+l, etc..?
1
vote
2answers
146 views

How to change the interpret of a variable in `zsh`?

I set a variable TEMPP='-I ../dir1 -I ../dir2' then I run gcc -M $TEMPP somefile.c It seems not to include ../dir1 and ../dir2 in the search list of the include file, and if there is a space at the ...
10
votes
2answers
775 views

Manipulating X key and pointer grabs on the command line

What command line tools exist to list and manage X server grabs? (That's grab as in key and pointer grabs, i.e. restricting the use of a particular key or mouse button to a particular application, or ...
3
votes
2answers
2k views

How to refresh a window by terminal? Or how to simulate `F5`?

I would like a way to refresh a specific window by the terminal. Probably I will need a comand to find the id or the name of the window and a command to refresh it. It looks like xrefresh cannot do ...
4
votes
3answers
882 views

What's the best way to determine the working directory for UNIX process using 'ps'?

I am running a Ruby command line script (rufus.sh)which ultimately calls Thread.new, which spawns a UNIX process as shown below. I run this script for more than 1 directory as the output of the ps ...
5
votes
2answers
1k views

How to list files and directories with directories first

I have two questions. First, which command lists files and directories, but lists directories first? Second question: I want to copy a list of files into a single directory, but make the target ...
5
votes
4answers
494 views

How can I create a empty file whose name begins with a dash? [duplicate]

How can we create a empty file with the unix name -stuff. It means the name start with -. I tried with touch -stuff but it didn't work.
2
votes
1answer
514 views

Why does unlink(1) support only one file?

I'm used to commands supporting multiple filename arguments if possible, but unlink doesn't: %> unlink a b unlink: extra operand `b' Try `unlink --help' for more information. I ended up using a ...
9
votes
3answers
3k views

How to launch a set of program inside tmux or gnome-terminal within a script?

I wanted to launch a few commands simultaneously in tmux or gnome-terminal or xfterminal , every different tab with a single command running , and close that tab when that command finishes. Any ...
1
vote
2answers
1k views

regex find and replace 0x0D, 0x0A characters

I have a text file of a database dump with some line break characters (0x0A0x0D) in the middle of lines. I want to replace them with commas, but I can't do it simply, because those characters are the ...
2
votes
4answers
805 views

Can I pass files between commands?

I am looking for a way to send the resulting file from one comamnd to another, So I dont have to save a copy on disk inbetween. For example, if I have rared files on disk and want to open them I would ...
2
votes
2answers
5k views

extract middle section of lines of a text file?

I am writing a php script to parse a large text file do to database inserts from it. However on my host, the file is too large, and I hit the memory limit for php. The file has about 16,000 lines; I ...
10
votes
2answers
823 views

How to temporarily switch from ssh to my local shell?

I'm using cygwin. and use it with ssh to login into a ubuntu server. sometimes, I want to switch back to my cygwin and then quickly switch to ubuntu shell. How to do this?
8
votes
2answers
2k views

How to replace all the tabs in each file in a file system branch with 2 spaces each?

I code Scala and it's convention is to use double spaces per level for identiation. But using different editors makes my sources filled with a mix of spaces and tabs. I'd like to refactor all the ...
18
votes
6answers
60k views

How to connect to a serial port as simple as using SSH?

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this $ serial /dev/ttyS0 I know I can cat the output ...
4
votes
3answers
1k views

Show lines matching a pattern and the 4 lines before each

For example, from this file: CREATE SYNONYM I801XS07 FOR I8010.I801XT07 * ERROR at line 1: ORA-00955: name is already used by an existing object CREATE SYNONYM I801XS07 FOR ...
6
votes
1answer
781 views

Find links and their positions in a PDF

I need to find all links in a PDF file, along with the page they're on and their X/Y position. Is there any tool or combination of tools I can use to do that?
11
votes
5answers
16k views

Linux ls to show only filename date and size

How can I use ls in linux to get a listing of filenames date and size only. I don't need to see the other info such as owner or permission. Is this possible?
4
votes
1answer
590 views

How can I generate CMYK images via the command line under Linux?

I have an application I have developed which is generating RGB PNG images with text on them via imageMagic, like so: convert -size 1000x1000 -density 300 xc:white -pointsize 24 \ -fill "rgb(0,0,0)" ...
5
votes
5answers
347 views

Conflict between my prompt definition and cat in zsh

I have a file on a remote filesystem that I know has a short text string in it (a sequence of numbers in a single line). If I open the file on a text editor like nano or Emacs I can see the string. ...
4
votes
4answers
432 views

ls command operating differently depending on recipient

How does commands like ls know what its stdout is? It seems ls is operating different depending on what the target stdout is. For example if I do: ls /home/matt/tmp the result is: a.txt b.txt ...
3
votes
3answers
4k views

How to watch rss feed for new entries from bash script?

I need to watch a RSS feed from our hudson ci server. Each time a new entry is available i want to play a sound by calling #>play sound.wav. Does anyone know a tool which can watch a rss-feed and ...
1
vote
1answer
759 views

Success/fail tests for cURL (don't execute second line if first line fails)

According to Using "&&" is not effective for cURL submit form (don't execute second line if first line fails) In below code; first line is curl submit; second line is for ...
7
votes
2answers
1k views

XFCE or pure X11 commands, toggle compositing immediately without restarting X

How can i disable compositing via the command line? I need to disable temporarily for some games, like Nexuiz, for use in a wrapper script to toggle compositing status.
2
votes
2answers
295 views

Using “&&” is not effective for cURL submit form (don't execute second line if first line fails)

I'm submitting to my website using cURL. I make cURL post it in timely fashion. In below code; first line is curl submit; second line is for queuing: curl -b cookies.txt \ -d title="$(sed ...
5
votes
4answers
270 views

How to send stderr to stdout with a pipe to another command?

I'm trying to capture all of the output of a build operation, and send it to myprogram. I seem to only be able to capture part of it. This is what I'm trying: make clean && make ...
1
vote
2answers
446 views

How to keep overwriting the contents of a file instead of appending to it

How do I clear the contents of a file before writing to it? For example: echo one > filename.tmp # filename.tmp now contains "one" echo two > filename.tmp # filename.tmp should now contain ...
1
vote
5answers
934 views

Display output to console while grep is used

In vim I use the following command to compile a tex file: pdflatex\ \-file\-line\-error\ \-shell\-escape\ \-interaction=nonstopmode\ $*\\\|\ grep\ \-P\ ':\\d{1,5}:\ ' this works in terms of getting ...
8
votes
9answers
5k views

linux diff tools: create list of modified files

How do I create a list of modified files programmatically using linux command line tools? I'm not interested in the difference in any particular file (delta, patch). I just want to have a list of new ...
1
vote
2answers
1k views

How to exit login screen and start commandline while at login screen

I am at the gnome 2 login screen but I want to exit and re-enter command-line environment. I remember there was a combination hot key one has to invoke.
21
votes
4answers
3k views

Single dashes `-` for single-character options, but double dashes `--` for words?

Where did the convention of using single dashes for letters and doubles dashes for words come from and why is continued to be used? For example if I type in ls --help, you see: -a, --all ...
1
vote
1answer
2k views

grep - recognize carriage return as new line [closed]

I want to search a webserver running unix for php-files containing a specific string. Usually I use these commands to accomplish this: find . -name "*.php" -print0 | xargs -0 grep -H -i "the string ...
2
votes
2answers
910 views

lsof for a specific process?

There's a bzip2 process running in the background and I have no idea where it came from. It's eating up a lot of resources. Can I do a reverse lsof to see which files are being accessed by this ...
10
votes
4answers
19k views

How to check password with Linux?

I want to check, from the linux command line, if a given cleartext password is the same of a crypted password on a /etc/shadow (I need this to authenticate web users. I'm running an embedded linux.) ...
3
votes
3answers
5k views

amixer - How to change recording channel?

So fat, I am setting up microphone settings : $ amixer set 'Rear Mic' 90% mute cap $ amixer set 'Rear Mic Boost' 80% But, after some sys. update, my default recoding chanell changed to 'Front Mic' ...
3
votes
2answers
2k views

Is there a command-line email client and auto-download attachment to a file?

Is there a linux email client that can run on command line and can be configured to fetch and automatically save attachments to the filesystem? Im currently using Thunderbird and it has a nice ...
5
votes
1answer
4k views

Configure wireless network from the command line

I know I can use ifconfig to configure my ethernet network interfaces. But can I also configure my wireless network interfaces using ifconfig. (It seems to be listed as eth1 in ifconfig output, why is ...
8
votes
4answers
7k views

How do I limit the number of files printed by ls?

Is there a way to limit the quantity of listed files on a ls command? I've seen: ls | head -4 but to get head to be executed I need to wait for ls to finish execution, and with directories with an ...
1
vote
6answers
306 views

Minimize need for sudo

Very often I need to use the sudo command because the command I'm running needs higher privileges. Is there some method to minimize the usage of sudo and/or a way to use it that's faster than typing ...
13
votes
1answer
19k views

How to use command line to change volume?

I am trying to control the volume using my programming script. How can I do the following in Fedora 15, Ubuntu linux? Mute/ Unmute Volume up and volume down Note: Please note that I use a web USB ...
4
votes
2answers
4k views

CalDAV command line client?

I'd like to do my CalDAV from the CLI just as I do my IMAP from mutt, what is my best bet as far as clients are concerned?
3
votes
1answer
546 views

Using iscan (GIMP plugin) from the command line

I'm something called iscan to use my scanner. However to use it, I need to go through a GUI to get my scanned pdf. When I run iscan --help (because just iscan launches the GUI), it tells me that it is ...