293
votes
2answers
72k views
Design question: Why was '~' chosen to represent the home directory?
I have often wondered why the ~ represents the home directory of a user. Is there a reason behind this? Or is it just some infrequently used character?
223
votes
7answers
19k views
Understanding the Linux kernel source
I am trying to understand how a function, say mkdir, works by looking at the kernel source. This is an attempt to understand the kernel internals and navigate between various functions. I know mkdir ...
223
votes
4answers
40k views
What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'?
I think these terms almost refer to the same thing, when used loosely:
terminal
shell
tty
console
What exactly do each of these terms refer to?
127
votes
3answers
18k views
What is the purpose of the lost+found folder in Linux and Unix?
There is a folder at the root of Linux and Unix operating systems called /lost+found/
What is it for? Under what circumstances would I interact with it? How would I interact with it?
101
votes
15answers
24k views
vim vs. emacs… and no, this is not a flame war
How would you compare these editors? What are the pros and cons of each?
[note] This is not meant to be answered by those who "hate one and love another" or those who haven't used both.
97
votes
3answers
5k views
What's the difference between $(stuff) and `stuff`?
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?
86
votes
16answers
15k views
Any reason NOT to run Linux in a VM all the time?
I've switched to using Arch Linux for most of my day to day work and don't need Windows for anything but gaming and the couple of apps that aren't ported to Linux like OneNote. My Linux distro is ...
85
votes
9answers
5k views
In Bash, when to alias, when to script, and when to write a function?
It's taken me almost 10 years of Linux usage to ask this question. It was all trial and error and random late-night internet surfing.
But people shouldn't need 10 years for this. If I were just ...
82
votes
15answers
36k views
Repeat a Unix command every x seconds forever
There's a builtin Unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For ...
82
votes
9answers
12k views
tmux vs. GNU Screen
Browsing through questions I found about tmux (I normally used GNU Screen). My question is what are pros and cons of each of them. Especially I couldn't find much about tmux.
78
votes
2answers
3k views
Bash: What does “>|” do?
I have just seen this written down;
$ some-command >| /tmp/output.txt
Vertical pipes are used in standard redirects "piping" the output of one command to another, is >| in fact completely ...
73
votes
13answers
8k views
How to do integer & float calculations, in bash or other languages?
Using echo "20+5" literally produces 20+5
What command can I use to get the actual sum, e.g. 25 in this case.
Also, what's the easiest way to do it just using bash for floating point, e.g.
echo ...
73
votes
7answers
4k views
The myths about viruses in unix/linux
Is it possible for my Linux box to become infected with a virus?
I haven't heard of it happening to anyone I know, and I've heard quite a few times that it isn't possible. Is that true?
If so, whats ...
73
votes
11answers
29k views
What if 'kill -9' does not work?
I have a process I can't kill with kill -9 <pid>. What's the problem in such a case, especially since I am the owner of that process. I thought nothing could evade that kill option.
71
votes
11answers
19k views
What are the pros/cons of deb vs. rpm?
For whatever reasons, I've always used RPM based distros (Fedora, Centos and currently openSUSE). I have often heard it stated that deb is better than rpm, but when asked why, have never been able to ...