0
votes
2answers
6 views

How to download all file with name emp* using curl from a FTP site

How can I get all files downloaded from a FTP site directory with file name like emp*. Please suggest.
1
vote
0answers
17 views

sed, insert file before last line

The following inserting file method for sed used to be working, even before last line, but not any more. Is it a bug in the current sed? Demo of inserting file method with sed: mkdir /tmp/test ...
0
votes
1answer
17 views

How can I check which ports are in use from the Linux command line?

I'm running a Node.JS application and need to figure out if something is using a certain port. How can I do this from the linux command line?
0
votes
0answers
12 views

Trouble streaming output from mplayer to a browser through ffmpeg, ffserve

Disclaimer: I'm the producer of the DVD used in this post, so there's no legal issue with me decoding the content :) I'm building a web-based DVD player using mplayer and ffmpeg. It's very close to ...
-1
votes
0answers
21 views

Why Ii obtain this error when I try to compile and install a software on Ubuntu 14.04?

I am not yet a Linux guy and I am going crazy trying to install a software compiling it on Ubuntu 14.04. This are the only provided instruction to install it: Debian First, make sure that ...
1
vote
2answers
34 views

Execute a previous command in a shell and get the command directly after

Once, a colleague of mine shown me a very useful method (shortcut?) on a shell (bash? csh?) to, after executing a previous command, automatically show the command after in history. For example, ...
4
votes
3answers
60 views

Linux: How to get current bandwidth usage from command line?

I'm looking for a good way to get the current total bandwidth usage on a linux machine, i've tried iftop, nethogs, but they doesn't show real bandwidth usage (compared to system monitor), anyway they ...
1
vote
1answer
15 views

Upload image to postimage.org using curl

I found a script that can upload image to postimage.org using curl. It was posted not long ago, on 2013-09-06, at http://crunchbang.org/forums/viewtopic.php?id=28867. The simplified script looks like ...
0
votes
2answers
47 views

shell script to start and stop executable jar in linux environment

I have to write start and stop script for an executable jar ex. executable.jar How to do it using shell scripting? I got success to do it for Windows environment with .bat file. But not able to ...
0
votes
0answers
17 views

Open pwd protected http stream in vlc from Linux CLI

Can anyone please advise me on how to open a pwd protected http stream from CLI in vlc? I checked out the --help and man pages, but they seem to offer only syntax for opening ftp, rmt and smb pwd ...
0
votes
0answers
4 views

linux net command for osx terminal? [duplicate]

i am trying to establish a way to use the same samba net commant found on a linux distro using samba 3.x but i am unable to identify the mac version of it reference to the net command: ...
2
votes
2answers
64 views

How can I execute a command and immediately quit the terminal?

It should be pretty clear what I'm trying to do: original script.sh: select blah in foo bar oof rab do cmd $blah break done Pretty basic stuff. The problem arises when I try the following: ...
22
votes
3answers
2k views

What is the Linux command that encapsulates almost all of the other commands?

I remember that for Linux running in embedded systems, due to size limitations, it can't pack as many commands as in ordinary workstations. So there is a do-it-all command that can mimic almost all ...
-1
votes
1answer
22 views

how to escape '$' in an awk statement in shell alias

I'm trying to write an alias that will kill all running php processes.. this is the command i got in my ~/.bash_profile alias killphp="ps aux | g [p]hp | awk '{print $3}' | xargs kill -9" this ...
0
votes
1answer
33 views

How can I do a recursive find and replace from the command shell?

Using a shell like bash or zshell, how can I do a recursive 'find and replace'? In other words, I want to replace every occurrence of '/path/to/folder' with '/other/dir' in all files in this directory ...
1
vote
1answer
21 views

redirect one bash line to stdout/terminal vs log

I have a bash script where I'm redirecting output into a file for logging. if test -t 1; then # stdout is a terminal exec > $OUTPUT_FILE 2>&1 else # stdout is not a terminal, no ...
1
vote
1answer
29 views

Arch Linux pacman error while loading shared libraries on Raspberry Pi

I know there are tons of forum posts on this, but I have found nothing on my exact problem. My Raspberry Pi just arrived and I installed Arch Linux and booted up, changed the timezone and password, ...
0
votes
1answer
22 views

pass filename(with space in the path) as argumant to a wine app in a bash script

I want to luanch an wine App with passing a file as argument. I've two file, with the first I don't have any problem but when there is a space in the path wine can't handle the address properly. here ...
0
votes
1answer
29 views

Does an awk script or command execute itself to every line it reads?

I got an awk script named my_awk: #!usr/bin/awk -f { if ($1 == "#START") { FS=":";} else if ($1 == "#STOP") { FS = " ";} else { print $3} } And I invoked it through: cat my_file | awk -f ...
2
votes
3answers
48 views

What's Linux test -a command test for?

Please take a look at the following code, snap=snapshot.file touch snapshot.file-1 $ [ -a $snap-1 ] && echo yes yes What does the test -a command tests for here? I tried info ...
0
votes
1answer
33 views

What's the strategy used by sort when field not found?

I got a file named test, its content is like 111 222 11 22 111 223 12 22 33 11 2 25 222 331 11 2 33 2 1 33 33 22 33 I used: sort -bk2.3 test But the result confused me, those lines which doesn't ...
0
votes
2answers
47 views

Why “ sort file > file ” would remove all the content of that file?

Today I'm learning sort command. I find that, I can use sort file1 > file2 To inject the sorted file into file2 But when I use sort file1 > file1 file1 become empty! Why?! I know I ...
25
votes
1answer
2k views

Why does deleting from the command line take significantly less time than from a GUI?

Something I wondered about as I was deleting a dozen or so images from my computer: With a quick rm -rf command on the directory's contents, all the images were gone in a snap. When I drag the same ...
0
votes
1answer
26 views

Remote server browser

Is there any tool for pretty display directory structure where I'm currently in? My flow is pretty tedious like cd 'dir1' ls cd 'child1' ls and so on. I'd like to have some NerdTree + console ...
0
votes
2answers
32 views

what is the difference between shell command staring with “.” and “./”? [duplicate]

In Linux shell, I've seen the command starting with "./" e.g. $ ./example But then I've also seen the similar command like $ . example.sh My question is do they have the same function?
0
votes
1answer
29 views

Does linux 2.6.32 have 'at' command, can I add this command into it?

I am trying to run 'at' command to execute a shell at morning. But I met this on the remote host bash: at: command not found I runed $PATH, it shows bash: /sbin:/bin:/usr/sbin:/usr/bin: As I ran ...
0
votes
0answers
43 views

Send command through PuTTY automatic login

I am using the following to login automatically to a remote server and then run commands listed in a commands.txt, like this: C:\path to\putty.exe -ssh adreese.ip -l user -pw Password -m C:\Path ...
0
votes
1answer
24 views

Change value in config without opening

Is it possible to change/uncomment value in linux configs without opening and go to line? Example: In php.ini we had expose_php = On and we want turn it off: $: magic_cmd "expose_php = Off"
3
votes
1answer
48 views

Using sed with parallel gives empty output when redirecting to file

I'm using the zsh shell. I am trying to use sed to substitute some text in many files, using parallel to speed up the process. When I tested this on one file and let the command output go to stdout I ...
1
vote
1answer
18 views

Pipeing lines to repeat commands

If my grep operation returns a list of ID's like: 12345 84758 49549 .. can I somehow feed/pipe each line to a commandline command's parameter? Like for example with the above result from grep, I'd ...
0
votes
1answer
24 views

Can less wrap lines like fmt does?

Like most people I use less as my terminal pager. Occasionally I view files consisting of very long lines of plain or marked-up text. By default less folds these lines at the terminal window edge. ...
0
votes
1answer
28 views

using sed to replace 1 line with a multi-line variable in ksh

I have the following text in a file: XXXX NNNN YYYY NNNN ZZZZ NNNN I want to replace the NNNN to make it look like this: XXXX NNNN DUTY FORECASTER: YYYY NNNN DUTY FORECASTER: ZZZZ NNNN ...
1
vote
2answers
44 views

How can I graphically open and display file at the client end in Linux over SSH connection?

I am using the xdg-open file-name command to open and display file at the user end, but can't graphically open and display file at the client end in Linux over SSH connection. So please help me to ...
0
votes
0answers
19 views

Virtual Consoles run from different DVI output than X

My virtual consoles (Alt F1-Alt F6) run from a different DVI output than X does. This requires me to unplug my monitor when I want to start X, which is a pain. I'd like to set them both to be ...
1
vote
1answer
34 views

How to get list of process ids that are in a given group id

Going by the man page, I would expect this to work: ps ah -o pid,pgrp -G 18322 But this shows exactly the same list as without the -G arguments. I want a saner way to produce this output: ps ah -o ...
2
votes
3answers
174 views

What exactly do the sudo -s command? and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
0
votes
1answer
24 views

bash scripting, run commands in all subfolders with selections

I need to run this command trjconv -s run.tpr -f run.xtc -pbc mol -ur compact -o unwrap for all the sub-directories following the naming pattern of us_0.0, us_-0.2, us_-0.4 ... us_-3.8. The ...
5
votes
1answer
21 views

PHP version for super user is fcgi instead of cli

I have a strange problem with PHP version when using CLI. When I login as root and use: php -v I get an info that php is running in CLI mode which is fine, but as soon as I use sudo php -v I get ...
0
votes
1answer
33 views

Linux browse and open network files with command line

I'm new to Linux. I have a Windows network connected to a Linux computer. When I try to browse Windows files from windows managers in Linux, it asks for user name, work group name and password. The ...
1
vote
2answers
56 views

Replacing every 10th pipe with new line in unix

Lets say I have fields: name, number, id I have a data file: name1|number1|id1|name2|number2|id2...etc I want to replace every 3rd pipe with a new line or '\n' so I get: name1|number1|id1 ...
10
votes
5answers
813 views

How to jump back to the first character in *nix command line?

When writing a long command in the *nix command line and having to go back to the first character, in order to add something at the beginning (for instance a nohup, when you realize the process will ...
0
votes
1answer
56 views

Delete file if number in filename less than xxxx

I have thousands files in format randomstring_XXXXXXXX.jpg where 'xxx' is unixtime (1388415305). Now I need to delete all files older than some (unixtime) date. Does anyone have a solution for this?
0
votes
1answer
40 views

Direct errors in find to /dev/null by default

On my OSX command line, find directs errors to STDOUT. I find this very inconvenient, and I also find it annoying to add 2>/dev/null to the end of the command every time. This brings up several ...
0
votes
1answer
59 views

Unclear on making sense of all the command-line-interfaces (CLI)s out there, and when/why to use them

Some background, I am making the mental effort to start using command line interface for all my work, on Windows, Mac OSX, and LINUX systems. It is true that we have a lot more flexibility in the ...
0
votes
1answer
20 views

Export image dimension to text?

I have an image called a.jpg. I use "feh - imlib2 based image viewer" to get the information about image dimension. The command I use is feh -l a.jpg And the result is NUM FORMAT WIDTH HEIGHT ...
0
votes
0answers
30 views

How to View BIOS Settings During Runtime

We write applications that provide component data up to a server for system health monitoring. One of our customers was testing our product and noted that the temperature reported by BIOS is hotter ...
1
vote
2answers
48 views

How do I run commands in a script as another user?

I have a need to have a single script run the majority of its commands as another user, but do not want to instruct my users to call it via sudo. Running the commands with an EOF here document is not ...
0
votes
2answers
55 views

Setting node path and allowing to run as sudo

I've got a raspberry pi that I'm running node on. I followed this guide http://joshondesign.com/2013/10/23/noderpi to install node. When I setup the NODE_JS_HOME, I can run node from the command ...
6
votes
3answers
478 views

How to whois new TLDs?

How can I look up new TLDs, such as .email, .guru, etc., using the whois command in linux? Running whois on a new TLD only gives the response: No whois server is known for this kind of object.
0
votes
2answers
54 views

Open multiple vim tabs and windows simultaneously from command line

I've got four files a b c d and would like to open them all in vim such that I have two tabs each vertically splitted into two windows; files a and b in the first tab and c and d in the second tab. ...