3
votes
1answer
65 views

Run command based on output of another command

OS: AIX 7100-04-1216 So basically I'm trying to write a for loop that sees which volumegroups I have on my system, which filesystems reside in those volume groups and what the size of each of those ...
1
vote
1answer
51 views

Why does the same sed regex (after grep) fail when run in a bash script vs bash command line?

Here's the script. It is successful when I run it from the BASH prompt, but not in the script. Any ideas? When I say "fails," I mean the sed regex doesn't match anything, so there is no replaced ...
1
vote
1answer
87 views

Change a value in a config file, or add the setting if it doesn't exist?

When modifying config files from the command line, I often want to find the setting in the config file and modify that line if that setting exists. If that setting doesn't exist, I want to add it to ...
20
votes
2answers
666 views

How do I move all files output from a command?

I have this grep command to find files without the word Attachments in them. grep -L -- Attachments * I want to move all the files that are output from that command. How do I do that in bash? Do I ...
2
votes
3answers
39 views

setting up script in a linux machine for scientific computation [closed]

I'd like to setup machine for test some computation in my old laptop, before replicate the tests on the server. The computation will be image-processing and machine learning, run some program, load ...
0
votes
0answers
92 views

Video tools for creating presentation

I have captured video (with audio) from presentation, slides (just images), and array of times (when slides was listed). Goal is to create presentation video: big slide with small video frame at the ...
0
votes
3answers
477 views

How to compact a chmod UNIX command

Is there anyway to compact the follow UNIX command: chmod 755 scriptA.ksh | chmod 755 scriptB.ksh | chmod 755 scriptC.ksh | chmod 755 scriptD.ksh The above command makes every KornShell (ksh) ...
1
vote
4answers
183 views

Is there a difference between ./script and bash script?

Given a shell script file that begins as #!/bin/bash # (bash script here), and has been chmod +xed, is there any difference in running ./script and bash script from the command-line?
1
vote
2answers
323 views

Need to copy files to existing directory and remove files already there with the same name but different extension

EDIT: Total rewrite of question for clarity. I have a directory tree (new) with a bunch of files of with an extension of .new. I have an identical tree (old) where many of the files have names ...
4
votes
1answer
68 views

How can I get information about my virtual desktops via the command line?

I'm curious how I can get information such as the dimensions of my desktop, which desktop is currently active, and what labels (if any) are set for my desktop enviornment (DE).
3
votes
2answers
676 views

How to get volume level from the command line?

I have a text status bar on a tiling window manager and I am using tcl to feed information to it. At the moment I need a command line that output the volume level 0% to 100%. I am using Arch Linux.
4
votes
2answers
473 views

Is there a way to simulate a “Close” event on various windows using the terminal?

I answered on Ask Ubuntu Quit all instances of gnome-terminal via a command but as you all can read gnome-terminal didn't seems to have a SIGcall I could use to simulate this "Close" event. So this ...
0
votes
1answer
124 views

how to list all the internet's IP ranges? [closed]

I was wondering if I list all the IP ranges directly available on the internet. perhaps also group them by country and ISP? I know that a lot of people do research nowadays on datamining and ...
0
votes
1answer
79 views

How can I use a variable from a script?

A bash script is running as I defined it in Startup Applications. It is possible to display on terminal a variable used in that script? If yes, how?
3
votes
2answers
399 views

How can I determine if HTML5 player is running in browser?

I would like to find a command-line or a script that will show me if HTML5 player is running or not in a browser (firefox or chromium). For example, to determine if Flash player is running in a ...
7
votes
3answers
1k views

How to constraint time a program runs in Linux?

I have several simulations to do, each is invoked with python simulate.py <parameter list>. The problem with these simulations is that some of them hang without quiting, which prevents me from ...
1
vote
0answers
108 views

rsstail Not Printing Output

I've installed rsstail 1.8 on my linux box and everything seems to be going smoothly, knock on wood, except for the part where rsstail isn't printing the streams. Running the command, I see that it's ...
2
votes
2answers
515 views

Averaging output of dstat

I need to average upload and download speed using dstat -n. How can I add all the received and sent data sizes that appear after dstat -n, so that I can add them and find average upload and download ...
1
vote
3answers
231 views

Rerunning the same command with a different parameter

I know that I can run the following command ls Some{File,Folder} And it is equivalent to running this: ls SomeFile SomeFolder (I also use it a lot for things like mv place_{a,b}) However, I was ...
2
votes
2answers
970 views

Concatenate multiple files under subdirectories

My directory structure is given below x:\Project_2012-158A\Sample_4041 SampleSheet.csv 4041_CGTACG_L002_R1_001.fastq 4041_CGTACG_L002_R2_001.fastq 4041_CGTACG_L006_R2_001.fastq ...
1
vote
5answers
1k views

Checking if a file exists in several directories

I've been working on this far too long and need some help. I need a script that will look at files in a directory and see if it exists in one of several directories. I need something like this: for ...
2
votes
0answers
157 views

How to emulate a KWin effect by command line?

I would like to apply the Toogle Invert Effect when I start my system. So, I need to know how to call this KWin effect using the terminal. OBS.: I'd tried xte "keydown Meta_L" "key i" "keyup ...
2
votes
2answers
667 views

What would it take to add a command to run a script at the completion any given random task?

I was playing around with Pushover, and had the thought that it would be cool if I could use it as an argument on any random command, so that it would run a pushover script at the end of the task, ...
1
vote
1answer
931 views

How to open a local URL (webpage) on the command line

On MacOS X I can run open /some/path/index.html and this would open the page index.html with the default software that handles .html files. Is there something similar on Ubuntu Linux? I have used ...
3
votes
3answers
900 views

command line audio with mpg123 - how to save position in audio and begin from that location next time?

I am contemplating using mpg123 as an audiobook player. I can't find any other good audiobook players for Linux, and I think mpg123 may be my best option. My audiobooks are organized by directories ...
3
votes
1answer
430 views

How can I copy all users .bash_history files into my home directory?

I am running as root. I want to copy all the users on the system's .bash_history files into my home directory. I can do this to combine all of them into one, but then I can't tell who's commands are ...
9
votes
3answers
650 views

How to pipe the list of commands displayed by of “tab complete”?

When using commands in bash I like the double tab option to display the available commands. Some commands have more possible matches than others: Is there a way I can pipe the output of the double ...
3
votes
3answers
3k 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 ...
5
votes
3answers
6k views

Storing output of command in shell variable

I have an operation using cut that I would like to assign result to a variable var4=echo ztemp.xml |cut -f1 -d '.' I get the error: ztemp.xml is not a command The value of var4 never gets ...
4
votes
2answers
330 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 ...
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
6answers
749 views

Best way run a command on each file in a directory tree

There appear be a number of ways to do this including loops in shell script, find and xargs. Which of these is best, and which is most portable?
158
votes
22answers
83k views

Repeat a Unix command every x seconds forever

There's a builtin Unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For ...