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

learn more… | top users | synonyms (1)

8
votes
7answers
7k views

Doing simple math on the command line using bash functions: $1 divided by $2 (using bc perhaps)

Sometimes I need to divide one number by another. It would be great if I could just define a bash function for this. So far, I am forced to use expressions like echo 'scale=25;65320/670' | bc but ...
6
votes
4answers
458 views

extracting certain info from output

I'm trying to extract certain info from ffmpeg output. Sample ffmpeg output: configuration: --enable-memalign-hack --enable-mp3lame --enable-gpl --disable-vhook --disable-ffplay --disable-ffserver ...
7
votes
3answers
7k views

Command Line Tool for monitoring Java Heap

Is there any command line tool for monitoring the heap size usage of Java in CentOS?
3
votes
1answer
727 views

Change xscreensaver lock option command

How could I change the lock option for the xscreensaver from the command line? Been looking around and couldn't find anything about it. xscreensaver-command -lock will lock it right away, which is ...
11
votes
8answers
15k views

What's the quickest way to add text to a file from the command line?

Occasionally I have a thought that I want to write into a file while I am at the terminal. I would want these notes all in the same file, just listed one after the other. I would also like a date / ...
16
votes
4answers
1k views

Copy image from command-line to clipboard

Is there a way in a bash to copy a picture to the clipboard? For example if there is a picture mypic.png I want to have a command like clipcopy mypic.png such that I can go for example to inkscape ...
2
votes
2answers
163 views

Index names of all the files in a plain text file

I've got this directory full of images, and I can do this: echo *.jpg image1.jpg image2.jpg image3.jpg # and so on How can I get the output in a plain text file in this format? image1.jpg ...
1
vote
2answers
312 views

Is there a convenient way to wrap a bash command list into rlwrap?

Thanks to a question on superuser.com, I found out about this utterly convenient rlwrap tool. It satisfies my needs (i.e. add command history to another cmdline tool), but I was wondering how I can ...
21
votes
4answers
875 views

Are Linux utilities smart when running piped commands?

I was just running a few commands in a terminal and I started wondering, does Unix/Linux take shortcuts when running piped commands? For example, let's say I have a file with one million lines, the ...
21
votes
9answers
33k views

Converting multiple image files from JPEG to PDF format

I want to convert some files from jpeg to pdf. I am using following command. $ convert image1.jpg image1.pdf But I have 100 images. How should I convert all of them to corresponding pdfs? I ...
5
votes
2answers
727 views

how does time command work

So when I type time <some_program> I have nice CPU time measurement. But exactly how is this achieved? Also does this have any performance impact on the some_program?
-1
votes
2answers
664 views

Downloading DeviantArt : Favourites, Groups, Gallery…

Is there any command-line Linux tool for downloading user favourites (including subfolders), selected users galleries, groups ? (Preferably with ability to run in incremental mode, to update rip from ...
9
votes
1answer
479 views

How do I 'unbook' a pdf

I have a pdf file that was made into a booklet format. It is meant to print on A4 paper in landscape orientation; here are two pages in the pdf, which should correspond to four pages in the actual ...
4
votes
1answer
280 views

Is there any way to have console (rogue) mode programs take over only part of the terminal screen?

I like the command line because it preserves the context of what I'm doing. But if I use a "rogue" mode program like vi or less, the whole screen gets taken over. Is a middle way possible, where the ...
9
votes
5answers
3k views

Displaying week's number in certain format using ncal or cal

Don't you just love it when two commands each do one thing you want but neither do both? This is what cal does. Nice formatting. Lacks week numbers though. $ cal January 2012 Su Mo Tu We ...
4
votes
2answers
2k views

Vim NERDTree re-size vsplit

I am using the NERDTree plugin for Vim. When using the s: open vsplit command, is it possible to resize the windows so that the file takes up a larger portion of the screen than the directory tree?
0
votes
1answer
302 views

Unable to follow steps for building application in Linux Os?

I was using these steps to build an application from Csipsimple but the problem is, they have mentioned it's for Linux and I tried, as a first step: subversion git quilt unzip wget swig2.0 python ...
0
votes
1answer
287 views

Backed an ipod up with dd, how to retrieve all tracks in one go with gnupod?

I have had gnupod for a while. Still haven't figured out how to use it though. I usually just go for gtkpod. So this question, in case anyone had any doubts after reading everything below, is purely ...
8
votes
3answers
8k views

Safe way to pass password for >1 programs in bash

I'm writing a bash script, and need to ask user for his password and pass it to openssl. Whilst openssl can read the password itself, I need for two runs of the program and don't want to ask the user ...
3
votes
2answers
2k views

Obtain .avi file info from command line

What is the best way to obtain information as bitrate, framerate, width/height of an movie file (in my case .avi) from the command line? I am looking for a basic tool that works similarly as ...
2
votes
3answers
6k views

How do I display the name of my audio card driver from the command line in Lubuntu 11.10?

I am running Lubuntu 11.10 and I want to display my Audio / Sound Card Driver from the command line.
7
votes
3answers
4k views

How do I tell what version of Gentoo & Linux is running?

Is there a way to tell from Bash what distro version # I'm running and also what Kernel version is included?
3
votes
2answers
978 views

How to understand the filesystem concepts used by encfs?

I do not hold a deep understanding of computer science concepts but would like to learn more about how the utility encfs works. I have a few question regarding the concept of filesystem in regards to ...
1
vote
2answers
4k views

list the difference and overlap between two plain data set [duplicate]

Possible Duplicate: Linux tools to treat files as sets and perform set operations on them I have two data sets, A and B. The format for each data set is one number per line. For instance, ...
3
votes
1answer
82 views

What is the best way to find directories that exactly match a string irrespective of the path?

Suppose I have the directories: /foo/ /A/B/C/foo/D/E/ /F/foo/G/H/foo/I/ How can get a result that lists all the directories whose basename exactly matches a given string (for example foo in here)? ...
2
votes
1answer
8k views

Among “ps” command output fields, %CPU isn't the actual CPU usage of the process?

For example, one of the output fields of this BSD style command, ps aux, is "%CPU". The alternative command, ps -efl outputs the "C" (or CP) field. As per the ps man page: %CPU is the cpu ...
1
vote
1answer
580 views

What causes delay in my keystrokes on OSX's Terminal application?

I'm using the OSX application Terminal to work remotely on Amazon EC2 servers through SSH. Occasionally and seemingly randomly, my keystrokes are delayed. I've tried reconnecting, restarting ...
14
votes
2answers
1k views

Accidently created a file called -X, how can I delete it? [duplicate]

Possible Duplicate: How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)? Like an idiot, I ran this command: tar -cf -X awstats-icon icon ...
12
votes
2answers
260 views

`test` and `[` - different binaries, any difference?

I noticed while answering another question that test and [ are different binaries, but the [ manpage pulls up test's. Besides the requirement for an ending ], is there any difference? If not, why are ...
1
vote
1answer
637 views

Execute command through SSH

I am writing a script to check whether all the servers in my organization are functioning properly. One of those is Zimbra mail server. I am trying to send a mail through sendmail provided by zimbra ...
7
votes
1answer
6k views

How to hide commands typed in a Linux shell?

Is there a way to hide what I'm typing in a shell, so the terminal doesn't echo my keystrokes, while still keeping the output of the command? For example, if I run ip addr show, the only thing on the ...
10
votes
3answers
6k views

Simplest way to password protect a directory and its contents without having to create new files?

I would like to password protect or encrypt a directory and all the files within it (for the whole directory tree below it). I do not want to bother the whole home directory, I want a specific ...
8
votes
3answers
3k views

How can I use ms-dos style wildcards with ls and mv?

I have the misfortune of coming from a MS-DOS background - but at least it makes me appreciate how much more powerful Linux is. I've been working on getting my Linux-Fu up to par, but there are a ...
37
votes
4answers
20k views

How can I send stdout to multiple commands?

There are some commands which filter or act on input, and then pass it along as output, I think usually to stdout - but some commands will just take the stdin and do whatever they do with it, and ...
2
votes
1answer
5k views

Use configuration file for ftp with auto login enabled upon initial connection

I would like to so the same thing like in SSH where you can save the server in the config file. I would also like to save my username and password, so that it is not prompted each time I connect. I ...
1
vote
2answers
651 views

run script asynchronously / in a different process

I have a simple php script <?php for($i=0;$i<10;$i++){ sleep(1); echo $i; } Which I run from the command line php myfile.php & I would expect I can do other things in the command line, ...
5
votes
3answers
452 views

Shortcut for fast recursive removal

Sometimes I want to delete large swaths of temporary files recursively, and recycle the directory name without waiting for the command to complete. (For example, if I want to nuke and re-checkout a ...
35
votes
6answers
20k views

Is there a tool to get the lines in one file that are not in another?

Is there any tool that can get lines which file A contains, but file B doesn't? I could make a little simple script with, e.g, perl, but if something like that already exists, I'll save my time from ...
2
votes
1answer
164 views

How can I adjust this short shell script to fit my needs?

I am attempting to force powertop to run when I log in by using the Startup Applications wizard in Ubuntu. Under the 'Command' entry, I've placed gnome-terminal -x ...
4
votes
2answers
2k views

the usage of < /dev/null & in the command line

I tried to run an example java program using the following command line. However, I do not know what is the trailing part < /dev/null & used for? java -cp /home/weka.jar ...
11
votes
4answers
2k views

Is it possible to configure ctrl-w (delete word)?

Normally, Ctrl-w deletes back to the last whitespace. Is it possible to configure it to use additional characters, such as /? Edit: To be more clear: I don't want to configure the key for it, I want ...
6
votes
4answers
535 views

pager program like less, able to repeat top N lines

Is there any way to make less program repeat first line (or first 2 lines) on every displayed page? Is there any other pager program which can do this? This would be a killer-app for database table ...
4
votes
3answers
8k views

Running python script from terminal without .py extension

I want to call a python script script.py from the terminal by simply typing script. Is this possible? If so, how? I know I can avoid typing python script.py by adding #!/usr/bin/env python to the top ...
4
votes
3answers
2k views

Delete everything except a few extensions

Can I modify the rm command with regular expression or something to delete every file in current directory except files with extensions *.bmp, *.wav and *.png? It should be case insensitive because ...
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 ...