Most Popular

1500 questions
172
votes
6 answers

How to avoid duplicate entries in .bash_history

The same command is listed in my history again and again. How can I avoid this? I know it's possible via HISTCONTROL but I haven't found the right way.
karthick87
  • 84,513
172
votes
13 answers

How do I delete multiple lines in nano without affecting the clipboard?

I can select all file by going to the 1st line Alt+\, start marking the text by Alt+A, go to the last line by Alt+/ But there, I don't know which key to remove the selected text. Hit delete doesn't work for me but Ctrl+K to cut the text will destroy…
Nam G VU
  • 2,378
172
votes
1 answer

What is the rationale for the `/usr` directory?

What is the rationale for the "unix system resources", or /usr directory, as described here, which duplicates many of the directory names under the root directory /? My purpose: I'm installing Oracle JDK for the umpteenth time and decided this time…
H2ONaCl
  • 10,039
171
votes
18 answers

How can I limit battery charging to 80% capacity?

I just learned that some Lenovo laptops include a utility that offers to limit battery charging capacity to within 0–80% in order to slow the attenuation of the battery lifespan: How can I do this in Ubuntu?
ændrük
  • 78,496
171
votes
1 answer

What are the differences between the different vim packages available in Ubuntu?

The difference between vim-gtk and vim-gnome has been discussed here. Ubuntu usually offers more than these two options for vim, e.g.: vim-nox vim-athena vim-* It is not clear which vim package have which dependecies and which one is preferable…
Dilawar
  • 1,811
171
votes
8 answers

Set "older" kernel as default grub entry

I installed a mainline kernel for testing purposes. I would like to set grub to boot from the older kernel by default. I know I can set the GRUB_DEFAULT=0 setting for the first page of grub but how do I set it to boot by default from one kernel in…
To Do
  • 15,833
171
votes
10 answers

Command to move a file to Trash via Terminal

I would like to know if there is a command I can issue in a terminal so I do not classically remove (rm) the file, but instead move it to trash (i.e. Nautilus Move to Trash behavior). In case there is such a command, I would also be interested in…
Rasmus
  • 8,655
171
votes
11 answers

How can a script check if it's being run as root?

I'm writing a simple bash script, but I need it to check whether it's being run as root or not. I know there's probably a very simple way to do that, but I have no idea how. Just to be clear: What's a simple way to write a script foo.sh, so that the…
Malabarba
  • 10,546
171
votes
3 answers

ifconfig missing after Ubuntu 18.04 install

I've just installed Ubuntu 18.04 and selected "minimal install". I then tried to run ifconfig in the terminal and got the following message -bash: ifconfig: command not found How come the net-tools package is not installed by default any more?
JiiB
  • 1,813
170
votes
8 answers

How to check opened/closed ports on my computer?

How to check the opened/closed ports on my computer? I used netstat -a on command line. Does the port status "LISTENING" indicate that the port is open? Is any port, that is not shown in the output, closed?
Router
  • 2,341
170
votes
9 answers

How to roll back Ubuntu to a previous version?

I just installed a new version of Ubuntu and I want to roll it back to the previous version. How can I do that? Is that even possible?
Mokus
  • 4,592
170
votes
7 answers

How to setup OpenVPN Client

I'm trying to setup OpenVPN using NetworkManager. The GUI seems buggy and unresponsive. Are there any other tools for setting up a VPN client?
170
votes
2 answers

cannot change screen size from 640x480 after 14.04 installation on VirtualBox OSX

After installing Ubuntu 14.04 guest on VirtualBox running on a Max OSX host, I am stuck with 640x480 screen resolution. Adding guest additions again doesn't help. Previous Ubuntu installations are fine with bigger resolution. The 'Detect Displays'…
user271956
  • 1,701
169
votes
3 answers

Does ssh key need to be named id_rsa?

I have come across this problem a couple of times when creating build servers with keyed authentication. I was wondering if anyone else has experience this. I have a couple of keys for my current user that may connect to different machines. Let say…
myusuf3
  • 35,659
169
votes
12 answers

How do I install and use the latest version of GNOME?

I followed the instructions for compiling GNOME Shell and it did compile with a few errors here and there but it didn't run. I installed GNOME Shell using sudo apt-get install gnome-shell but I got version 2.31.x, while the latest is 2.91.5 or…