Most Popular
1500 questions
117
votes
6 answers
If Linux is only a kernel, then how were its first versions used (without distribution)?
Linux is only a kernel, and if users want to use it, then they need a complete distribution. That being said, how were the first versions of Linux used when there were no Linux distributions?
noop
- 1,025
- 2
- 8
- 4
117
votes
6 answers
Why do we use "./" (dot slash) to execute a file in Linux/UNIX?
Why do we use ./filename to execute a file in linux?
Why not just enter it like other commands gcc, ls etc...
Renjith G
- 5,788
- 16
- 40
- 48
117
votes
12 answers
Kill all background jobs
Is there a more compact form of killing background jobs than:
for i in {1..5}; do kill %$i; done
Also, {1..5} obviously has a hard-coded magic number in it, how can I make it "N" with N being the right number, without doing a:
$(jobs | wc -l)
I…
Robottinosino
- 5,271
- 12
- 39
- 51
117
votes
8 answers
How to install program locally without sudo privileges?
Assume I have ssh access to some Ubuntu server as user and I need some not system tools to be installed for convenience (mc, rtorrent, mcedit). I do not want to bother admins for these small programs.
Is there a way to install them (make them run)…
yura
- 1,317
- 2
- 10
- 8
117
votes
2 answers
What are the systemctl options to "List all failed units"
systemctl
Returns a list of the units, whether they are loaded, active, their sub and description.
systemctl is-failed
Returns a list of status only.
What is the syntax to return the details of the failed units?
Tai Paul
- 1,281
- 2
- 8
- 7
117
votes
4 answers
Does sort support sorting a file in-place, like `sed --in-place`?
Am I blind or is there no option like --in-place for sort?
In order to save results to the input file, sed uses -i (--in-place).
Redirecting the output of sort to the input file
sort < f > f
results in making it empty. If there is no --in-place…
Grzegorz Wierzowiecki
- 13,865
- 23
- 89
- 137
117
votes
12 answers
How do I check if a variable exists in an 'if' statement?
I need to check a variable's existence in an if statement. Something to the effect of:
if [ -v $somevar ]
then
echo "Variable somevar exists!"
else
echo "Variable somevar does not exist!"
And the closest question to that was this, which…
user104976
117
votes
1 answer
there are screens in the list, but "no screen to be resumed"
When I type screen -r I expect to either see: A list of screens to resume, or a message "There is no screen to be resumed."
Today, I see there is one screen, but I still get the message that there is no screen to be resumed:
[root@server chiliNUT]#…
chiliNUT
- 1,669
- 3
- 16
- 18
117
votes
2 answers
How do keyboard input and text output work?
Suppose I press the A key in a text editor and this inserts the character a in the document and displays it on the screen. I know the editor application isn't directly communicating with the hardware (there's a kernel and stuff in between), so what…
Gilles 'SO- stop being evil'
- 807,993
- 194
- 1,674
- 2,175
116
votes
4 answers
Create a symbolic link relative to the current directory
I'm trying to create a symbolic link in my home directory that points to a directory on my external HDD.
It works fine when I specify it like this:
cd ~
ln -s /run/media/name/exhdd/Data/ Data
However it creates a faulty link when I try this:
cd…
jcora
- 3,874
- 7
- 34
- 52
116
votes
4 answers
How to print only the duplicate values from a text file?
Suppose there is a column of numeric values like following:
File1:
1
2
3
3
3
4
4
4
5
6
I want the output:
3
4
That is, only the repeated lines. Are there any command line tools to find this out in Linux? (NB: The values are numerically sorted).
N. F.
- 2,109
- 8
- 24
- 24
116
votes
6 answers
How to get keycodes for xmodmap?
I'm trying to use xmodmap to remap Alt / Super keys on Dell L100 keyboard, and have trouble getting the keycodes.
For instance, using xev doesn't give me keycode for Alt
FocusOut event, serial 36, synthetic NO, window 0x4a00001,
mode…
Yaroslav Bulatov
- 1,261
- 2
- 9
- 5
116
votes
9 answers
Why is /dev/null a file? Why isn't its function implemented as a simple program?
I am trying to understanding the concept of special files on Linux. However, having a special file in /dev seems plain silly when its function could be implemented by a handful of lines in C to my knowledge.
Moreover you could use it in pretty much…
Ankur S
- 1,208
- 2
- 7
- 17
116
votes
5 answers
How to define and load your own shell function in zsh
I am having a hard time defining and running my own shell functions in zsh. I followed the instructions on the official documentation and tried with easy example first, but I failed to get it work.
I have a folder:
~/.my_zsh_functions
In this…
Amelio Vazquez-Reina
- 40,169
- 77
- 197
- 294
116
votes
5 answers
Is there a command to list all open displays on a machine?
When SSH'd locally into my computer (don't ask, it's a workaround), I can't start graphical applications without running:
export DISPLAY=:0.0
If I run this first and then run a graphical application, things work out. If not, it doesn't work,…
Naftuli Kay
- 38,686
- 85
- 220
- 311