Most Popular
1500 questions
243
votes
5 answers
How to get the complete and exact list of mounted filesystems in Linux?
I usually use mount to check which filesystems are mounted. I also know there is some connection between mount and /etc/mtab but I'm not sure about the details. After reading How to check if /proc/ is mounted I get more confused.
My question is: How…

xanpeng
- 5,725
243
votes
4 answers
Why are tar archive formats switching to xz compression to replace bzip2 and what about gzip?
More and more tar archives use the xz format based on LZMA2 for compression instead of the traditional bzip2(bz2) compression. In fact kernel.org made a late "Good-bye bzip2" announcement, 27th Dec. 2013, indicating kernel sources would from this…
user44370
242
votes
5 answers
How to use wildcards (*) when copying with scp?
Why can't I copy with scp when I'm using * characters in the path?
scp SERVERNAME:/DIR/* .
What configuration does SCP need in order to allow * in the path?
UPDATE: the problem is not on server side; pscp is trying to use SCPv1, and that's why the…

LanceBaynes
- 40,135
- 97
- 255
- 351
242
votes
10 answers
What makes grep consider a file to be binary?
I have some database dumps from a Windows system on my box. They are text files. I'm using cygwin to grep through them. These appear to be plain text files; I open them with text editors such as notepad and wordpad and they look legible. However,…

user394
- 14,404
- 21
- 67
- 93
240
votes
15 answers
umount: device is busy. Why?
When running umount /path I get:
umount: /path: device is busy.
The filesystem is huge, so lsof +D /path is not a realistic option.
lsof /path, lsof +f -- /path, and fuser /path all return nothing. fuser -v /path gives:
USER …

Ole Tange
- 35,514
239
votes
7 answers
How to move and overwrite subdirectories (and files) to parent directory?
I have a ton of files and dirs in a subdirectory I want to move to the parent directory. There are already some files and dirs in the target directory which need to be overwritten. Files that are only present in the target should be left untouched.…

EricSchaefer
- 2,823
239
votes
11 answers
Where are cron errors logged?
If I setup cron jobs incorrectly they appear to silently fail. Where should I look for an error log to understand what went wrong?

Brian Lyttle
- 2,651
238
votes
8 answers
Why do I need a tty to run sudo if I can sudo without a password?
I have configured sudo to run without a password, but when I try to ssh 'sudo Foo', I still get the error message sudo: sorry, you must have a tty to run sudo.
Why does this happen and how can I work around it?

merlin2011
- 3,925
236
votes
4 answers
Do the parent directory's permissions matter when accessing a subdirectory?
If I have a root folder with some restrictive permission, let's say 600, and if the child folders/files have 777 permission will everybody be able to read/write/execute the child file even though the root folder has 600?

Ken Li
- 2,495
233
votes
9 answers
Looping through files with spaces in the names?
I wrote the following script to diff the outputs of two directores with all the same files in them as such:
#!/bin/bash
for file in `find . -name "*.csv"`
do
echo "file = $file";
diff $file /some/other/path/$file;
read…

Amir Afghani
- 7,203
- 11
- 27
- 23
233
votes
3 answers
How do I remove a directory and all its contents?
In bash all I know is that
rmdir directoryname
will remove the directory but only if it's empty. Is there a way to force remove subdirectories?

Piper
- 2,625
233
votes
4 answers
What is the purpose of using shift in shell scripts?
I have came across this script:
#! /bin/bash
if (( $# < 3 ));…

Patryk
- 14,096
232
votes
4 answers
How can I set "vi" as my default editor in UNIX?
I believe I can do something like export EDITOR=vi, but I'm not sure what exactly to enter, and where.
How can I set "vi" as my default editor?

Donny P
- 2,531
231
votes
7 answers
How can I see dmesg output as it changes?
I'm writing a device driver that prints error message into ring buffer dmesg output.
I want to see the output of dmesg as it changes.
How can I do this?

Milad Khajavi
- 3,187
231
votes
21 answers
How to download portion of video with youtube-dl command?
I am using Ubuntu, and the youtube-dl command is working absolutely fine.
However, now I want to download only a portion a video that is too long. So I want to download only a few minutes of that video, e.g. from minute 13 to minute 17.
Is there any…

user3181614
- 2,411