Most Popular
1500 questions
289
votes
10 answers
How to know if a disk is an SSD or an HDD
I want to know whether a disk is a solid-state drive or hard disk.
lshw is not installed. I do yum install lshw and it says there is no package named lshw. I do not know which version of http://pkgs.repoforge.org/lshw/ is suitable for my CentOS.
I…
user4951
- 10,329
- 28
- 71
- 92
289
votes
4 answers
Can't resume screen, says I am already attached?
I am working on a remote Debian Jessie server. I have started a screen session, started running a script, then been disconnected by a network timeout.
Now I have logged in again and want to resume the session.
This is what I see when I list…
Richard
- 3,273
- 5
- 15
- 13
288
votes
6 answers
What's the difference between $(stuff) and `stuff`?
There are two syntaxes for command substitution: with dollar-parentheses and with backticks.
Running top -p $(pidof init) and top -p `pidof init` gives the same output. Are these two ways of doing the same thing, or are there differences?
tshepang
- 64,472
- 86
- 223
- 290
287
votes
7 answers
What do options `ServerAliveInterval` and `ClientAliveInterval` in sshd_config do exactly?
I found this question, but I'm sorry I don't quite understand the settings on the two variables ServerAliveInterval and ClientAliveInterval mentioned in the accepted response. If my local server is timing out, should I set this value to zero? Will…
M. Tibbits
- 3,157
- 2
- 17
- 9
287
votes
2 answers
Recursively delete all files with a given extension
I want to delete all *.o files in a directory and its sub-directories. However, I get an error:
sashoalm@aspire:~/.Workspace.OLD$ rm -r *.o
rm: cannot remove `*.o': No such file or directory
On the other hand, rm *.o works, but it's not recursive.
sashoalm
- 5,760
- 11
- 32
- 47
286
votes
28 answers
SSH tunneling error: "channel 1: open failed: administratively prohibited: open failed"
When I open this ssh tunnel:
ssh -nXNT -p 22 localhost -L 0.0.0.0:8984:remote:8983
I get this error when trying to access the HTTP server running on localhost:8984:
channel 1: open failed: administratively prohibited: open failed
What does this…
Neil
- 3,402
- 2
- 17
- 15
285
votes
16 answers
How do I find out what hard disks are in the system?
I need to know what hard disks are available, including ones that aren't mounted and possibly aren't formatted. I can't find them in dmesg or /var/log/messages (too much to scroll through). I'm hoping there's a way to use /dev or /proc to find out…
xenoterracide
- 57,918
- 74
- 184
- 250
284
votes
12 answers
How do I convert an epoch timestamp to a human readable format on the cli?
How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome).
xenoterracide
- 57,918
- 74
- 184
- 250
283
votes
3 answers
Most efficient method to empty the contents of a file
I am aware of three methods to delete all entries from a file.
They are
>filename
touch filename1
filename < /dev/null
Of these three I abuse >filename the most as that requires the least number of keystrokes.
However, I would like to know which…
debal
- 3,664
- 5
- 17
- 18
281
votes
24 answers
Efficiently delete large directory containing thousands of files
We have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files.
There are so many files that performing rm -rf returns an error and instead what we need to do is something like:
find /path/to/folder -name "filenamestart*"…
Toby
- 3,973
- 4
- 20
- 16
280
votes
9 answers
How can I display the contents of a text file on the command line?
I would like to display the contents of a text file on the command line. The file only contains 5-6 characters. Is there an easy way to do this?
Sam Weinberg
- 2,913
- 2
- 13
- 5
280
votes
10 answers
What is the real difference between "apt-get" and "aptitude"? (How about "wajig"?)
I know that both apt-get and aptitude are command line package management interfaces on Debian derived Linux, with different options, but I'm still somewhat confused. Under the hood, aren't they using the same APT system?
Why does Debian maintain…
Kevin Cantu
- 3,774
- 4
- 18
- 13
280
votes
16 answers
List available updates but do not install them
I want my cron-run reporting script to notify me in case there are updates for my packages. Is the a way to make apt-get give me the list of available updates but don't do anything more?
Morris
- 2,809
- 2
- 15
- 3
279
votes
10 answers
How can I send stdout to multiple commands?
There are some commands which filter or act on input, and then pass it along as output, I think usually to stdout - but some commands will just take the stdin and do whatever they do with it, and output nothing.
I'm most familiar with OS X and so…
cwd
- 44,479
- 71
- 146
- 167
279
votes
4 answers
How does a Segmentation Fault work under-the-hood?
I can't seem to find any information on this aside from "the CPU's MMU sends a signal" and "the kernel directs it to the offending program, terminating it".
I assumed that it probably sends the signal to the shell and the shell handles it by…
Braden Best
- 2,183
- 2
- 12
- 12