Most Popular

1500 questions
109
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…
Tobias Kienzler
  • 9,184
  • 13
  • 65
  • 106
109
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,211
  • 2
  • 8
  • 8
109
votes
7 answers

Set and Shopt - Why Two?

set and shopt are both shell builtins that control various options. I often forget which options are set by which command, and which option sets/unsets (set -o/+o, shopt -s/-u). Why are there two different commands that seemingly do the same thing…
Kevin
  • 40,087
  • 16
  • 88
  • 112
109
votes
2 answers

How can I use `find` and sort the results by mtime?

I want to use find but sort the results reverse chronologically as with ls -ltr. Is this possible through any combo of flags or pipelines?
dan
  • 4,007
  • 5
  • 26
  • 34
109
votes
6 answers

zipimport.ZipImportError: can't decompress data; zlib not available

On RHEL 6.6, I installed Python 3.5.1 from source. I am trying to install pip3 via get-pip.py, but I get Traceback (most recent call last): File "get-pip.py", line 19177, in main() File "get-pip.py", line 194, in main …
Flair
  • 1,191
  • 2
  • 7
  • 6
109
votes
6 answers

How to limit network bandwidth?

We are hosting an application on remote server. We need to test it with a limited network bandwidth (for users with bad Internet access). Can I limit my internet bandwidth? For instance: 128 KB per second. This question focuses on system-wide or…
Kiril Kirilov
  • 1,227
  • 3
  • 11
  • 9
109
votes
5 answers

How to list all loadable kernel modules?

I'm looking for a few kernel modules to load i2c-dev and i2c-bcm2708. But the modprobe command returns: sudo modprobe i2c-dev modprobe: module i2c-dev not found in modules.dep How do I list all the available modules in the system? In which…
UserK
  • 2,334
  • 5
  • 21
  • 25
109
votes
10 answers

Does `sl` ever show the current directory?

For those out of the loop, sl is a humourous command line tool that is meant to trip people up if they mistype ls. When invoked it prints a Steam Locomotive. For example: ( ) (@@) ( ) (@) () @@ O @ O @ …
user53306
108
votes
1 answer

How do I force yum to install without prompting the user, using bash?

I'm writing a bash script to install php5.4 and I'd like to automate this for a test VM. The rpm command I have is: rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm yum install php54w Now, in the middle of this running, there is a user prompt…
Bradley
  • 1,489
  • 3
  • 10
  • 15
108
votes
5 answers

How to open the same directory in another panel in Midnight Commander?

In Midnight Commander, how to quickly set the right panel to the same directory as the left panel (and vice versa)?
Ivan
  • 17,368
  • 35
  • 93
  • 118
108
votes
9 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
  • 98,580
  • 191
  • 570
  • 977
108
votes
4 answers

What is meant by mounting a device in Linux?

I've heard the term "mounting" when referring to devices in Linux. What is its actual meaning? How it handling now unlike older versions? I haven't done that manually via the command-line. Can you give the steps (commands) for mounting a simple…
Renjith G
  • 5,788
  • 16
  • 40
  • 48
108
votes
4 answers

Understanding "IFS= read -r line"

I obviously understand that one can add value to internal field separator variable. For example: $ IFS=blah $ echo "$IFS" blah $ I also understand that read -r line will save data from stdin to variable named line: $ read -r line <<< blah $ echo…
Martin
  • 7,284
  • 40
  • 125
  • 208
108
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,145
  • 21
  • 59
  • 79
108
votes
7 answers

creating a tar archive without including parent directory

I am trying to create a graphical program for my script. Inside the script I use tar to create a tar archive. From the graphical program I get the full name of file that I want to create a tar archive. tar -cvf temp.tar…
Sujit Maharjan
  • 1,395
  • 3
  • 9
  • 10