Most Popular

1500 questions
93
votes
5 answers

Extract file from docker image?

I'd like to extract a file from a Docker image without having to run the image. The docker save option is not currrently a viable option for me as it's saving too huge of a file just to un-tar a specific file.
BlakBat
  • 1,012
  • 1
  • 7
  • 11
93
votes
5 answers

Fix or alternative for mktemp in OS X

I'm looking at a bash script someone else wrote that uses mktemp: TEMP=`mktemp --directory` However, this line does not work on my machine (OS X 10.6). How would I fix this line so that it is cross-un*x-like-platform compatible? EDIT: An…
soundly_typed
  • 1,033
  • 1
  • 7
  • 6
93
votes
2 answers

Shell Syntax: How to correctly use \ to break lines?

I used to believe that the appropriate way of breaking the lines in a list is command1 && \ command2 It turned out that it isn't so , one doesn't need \ $ [ $(id -u) -eq 1000 ] && > echo…
Sergiy Kolodyazhnyy
  • 16,187
  • 11
  • 53
  • 104
93
votes
5 answers

Problem of Can't set locale; make sure $LC_* and $LANG are correct!

When I always try to install new package I get this message: Can't set locale; make sure $LC_* and $LANG are correct! perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_GB:en", LC_ALL…
Ismail Sensei
  • 1,179
  • 1
  • 10
  • 13
93
votes
9 answers

Recovering accidentally deleted files

I accidentally deleted a file from my laptop. I'm using Fedora. Is it possible to recover the file?
C.S.
  • 1,783
  • 2
  • 18
  • 21
93
votes
7 answers

How to set custom resolution using xrandr when the resolution is not available in 'Display Settings'

I'm a new Linux user trying to change the screen resolution as there is no option under display. I have successfully managed to add new resolutions by fluke by following online guide. I don't have a GPU, I don't know if this is the issue? Below is…
nick
  • 941
  • 1
  • 7
  • 4
93
votes
6 answers

How to copy a directory recursively using hardlinks for each file

I want to create a "copy" of a directory tree where each file is a hardlink to the original file Example: I have a directory structure: dirA/ dirA/file1 dirA/x/ dirA/x/file2 dirA/y/ dirA/y/file3 Here is the expected result, a "copy" of the…
Gudmundur Orn
  • 1,981
  • 1
  • 11
  • 9
93
votes
5 answers

Difference between cp -r and cp -R (copy command)

cp -r is meant to copy files recursively, and cp -R for copying directories recursively. But I've checked, and both appear to copy both files and directories, the same thing. So, what's the difference actually?
its_me
  • 13,709
  • 23
  • 54
  • 52
93
votes
14 answers

chroot: failed to run command ‘/bin/bash’: No such file or directory

When I run the chroot command an error is given: failed to run command ‘/bin/bash’: No such file or directory
USER3254789
  • 1,061
  • 1
  • 7
  • 3
93
votes
3 answers

How to view datetime stamp for history command in Zsh shell

When I run the history command on my ubuntu server, I get output as follows: history ... 25 cd ~ 26 ls -a 27 vim /etc/gitconfig 28 vim ~/.gitconfig I want to view the datetime of a particular user. However when I assume…
JohnMerlino
  • 5,941
  • 11
  • 34
  • 38
93
votes
4 answers

How do I completely silence a cronjob to /dev/null/?

On my Ubuntu-Desktop and on my debian-server I have a script which needs to be executed each minute (a script that calls the minute-tic of my space online browsergame). The problem is that on debian derivates cron is logging to /var/log/syslog…
rubo77
  • 27,777
  • 43
  • 130
  • 199
92
votes
12 answers

Why is Linux's filesystem designed as a single directory tree?

Can anyone explain why Linux is designed as a single directory tree? Whereas in Windows we can have multiple drives like C:\, and D:\, there is a single root in Unix. Any specific reason there?
user2720323
  • 3,549
  • 7
  • 24
  • 26
92
votes
9 answers

How to see disk details like manufacturer in Linux

With sfdisk -s I can see the disk capacity as follows: $ sfdisk -s /dev/cciss/c0d0: 143338560 total: 143338560 blocks How do I see disk details like disk manufacturer? I tried hdparm, but got an error: $ hdparm -i …
user3266
92
votes
3 answers

Linux network troubleshooting and debugging

From time to time, Linux and Unix users are faced with various network problems. Many of these problems are presented here and at some other troubleshooting forums, but they are very concrete and contain a lot of additional technical information,…
dr.
  • 2,351
  • 3
  • 16
  • 9
92
votes
6 answers

What is the difference between kernel drivers and kernel modules?

When I do a lspci -k on my Kubuntu with a 3.2.0-29-generic kernel I can see something like this: 01:00.0 VGA compatible controller: NVIDIA Corporation G86 [Quadro NVS 290] (rev a1) Subsystem: NVIDIA Corporation Device 0492 Kernel driver in…
JohnnyFromBF
  • 3,476
  • 10
  • 32
  • 42