Most Popular

1500 questions
111
votes
7 answers

Shell script fails: Syntax error: "(" unexpected

I've been working on a script that automates setting up a development environment for Raspberry Pi development (step by step details that work are here). The script is linked in that article but convenience you can find it here also. Now when run…
kemra102
  • 1,111
111
votes
4 answers

What is the difference between sourcing ('.' or 'source') and executing a file in bash?

What's the difference between executing a script like this: ./test.sh and executing a script like this: . test.sh? I tried a simple, two-line script to see if I could find if there was a difference: #!/bin/bash ls But both . test.sh and ./test.sh…
Nathan
  • 1,243
111
votes
8 answers

"Input/output error" when accessing a directory

I want to list and remove the content of a directory on a removable hard drive. But I have experienced "Input/output error": $ rm pic -R rm: cannot remove `pic/60.jpg': Input/output error rm: cannot remove `pic/006.jpg': Input/output error rm:…
Tim
  • 101,790
111
votes
5 answers

Do progress reports/logging information belong on stderr or stdout?

Is there an official POSIX, GNU, or other guideline on where progress reports and logging information (things like "Doing foo; foo done") should be printed? Personally, I tend to write them to stderr so I can redirect stdout and get only the…
terdon
  • 242,166
111
votes
5 answers

Save all the terminal output to a file

Is there some way of saving all the terminal output to a file with a command? I'm not talking about redirection command > file.txt Not the history history > file.txt, I need the full terminal text Not with hotkeys ! Something like terminal_text >…
user78927
111
votes
8 answers

Yum: How can I view variables like $releasever, $basearch & $YUM0?

I am setting up a yum repository, and need to debug some of the URLs in the yum.conf file. I need to know why is Scientific Linux trying to grab this URL, when I was expecting it to grab another URL: # yum install package…
Stefan Lasiewski
  • 19,754
  • 24
  • 70
  • 85
111
votes
9 answers

How to find the installation path for a software under linux?

Under linux, I launch a software by typing, e.g., fluidplot. How can I find the installation path for this software?
user5997
  • 1,371
111
votes
2 answers

Understanding %CPU while running top command

I am trying to understand what %CPU means when I run top. I am seeing %CPU for my application at "400" or "500" most of the time. Does anyone know what this means? 19080 david 20 0 27.9g 24g 12m S 400 19.7 382:31.81 paper_client lscpu gives…
david
  • 2,187
  • 7
  • 25
  • 31
110
votes
10 answers

convert webp to jpg error: "no decode delegate for this image format" and "missing an image filename"

I'm using ubuntu 12.04. I've installed libwebp2 & libwebp-dev So far, no example found on the net of converting webp to jpg. Some webp files can easily converted by using imagemagick with command convert file.webp file.jpg but lots of webp files…
apasajja
  • 1,917
110
votes
1 answer

How to determine the filesystem of an unmounted device?

Possible Duplicate: Find filesystem of a partition from a script How to show the filesystem type via the terminal? I'm looking for a command that yields the filesystem type as mount would use/detect it, without actually mounting it. It should…
110
votes
4 answers

What is the difference between "cat file | ./binary" and "./binary < file"?

I have a binary (that I can't modify) and I can do: ./binary < file I also can do: ./binary << EOF > "line 1 of file" > "line 2 of file" ... > "last line of file" > EOF But cat file | ./binary gives me an error. I don't know why it doesn't work…
Boris
  • 1,073
110
votes
2 answers

Why is pattern "command || true" useful?

I am currently exploring Debian packages, and I have been reading some code samples. And on every line in, for example, the postinst script is a pattern. some command || true another command || true So if some command fails, then the line returns…
carpenter
  • 1,221
110
votes
3 answers

grep inside less?

I'm currently sifting through a lot of unfamiliar logs looking for some issues. The first file I look at is Events.log, and I get at least three pages in less which appear to display the same event at different times – an event that appears to be…
forquare
  • 3,496
110
votes
4 answers

How do I know which version of Debian I'm running?

In a tutorial, I'm prompted "If you are running Squeeze, follow these instructions..." and "If you are running Wheezy, follow these other instructions..." When I run uname, I get the following information: Linux dragon-debian 3.2.0-4-686-pae #1 SMP…
IQAndreas
  • 10,345
110
votes
3 answers

How to grep the output of cURL?

I need to retrieve the expiry date of an SSL cert. The curl application does provide this information: $ curl -v https://google.com/ * Hostname was NOT found in DNS cache * Trying 212.179.180.121... * Connected to google.com (212.179.180.121) port…
dotancohen
  • 15,864