Most Popular

1500 questions
835
votes
9 answers

How to increment a variable in bash?

I have tried to increment a numeric variable using both var=$var+1 and var=($var+1) without success. The variable is a number, though bash appears to be reading it as a string. Bash version 4.2.45(1)-release (x86_64-pc-linux-gnu) on Ubuntu 13.10.
user221744
  • 8,361
  • 3
  • 13
  • 4
821
votes
22 answers

Command for determining my public IP?

If I check with google, I can see my public IP. Is there something on the Ubuntu command-line which will yield me the same answer?
kfmfe04
  • 8,689
  • 4
  • 18
  • 21
817
votes
4 answers

What is the difference between apt and apt-get?

I read about the new fancy progress bar which was added to apt 1.0 in Softpedia and how to enable it here. However on running sudo apt-get update, I did not see the fancy progress bars. On reading the second link again, the solution explicitly…
nik90
  • 12,609
807
votes
16 answers

How do I reset a lost administrative password?

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there. I've tried the suggestions on the website, and I have been unsuccessful in deleting the…
user9904
804
votes
7 answers

How do I rename a directory via the command line?

I have got the directory /home/user/oldname and I want to rename it to /home/user/newname. How can I do this in a terminal?
N.N.
  • 18,219
784
votes
18 answers

How do I find the amount of free space on my hard drive?

Is there a way to quickly check the amount of free / used disk space in Ubuntu? I would assume you could right click on 'file system' in the file browser and choose 'properties' or something but there is no such option.
greg
  • 10,293
783
votes
4 answers

How to delete a non-empty directory in Terminal?

How do I delete the following directory? I typed: rmdir lampp This error comes up: rmdir: failed to remove `lampp': Directory not empty Is there a command to delete all the files in the directory and delete the directory folder?
naveen
  • 8,057
  • 4
  • 15
  • 14
776
votes
25 answers

How can I reduce the file size of a scanned PDF file?

I have a 72.9 MB PDF file that I need to shrink to 500 KB or below. The file was a JPEG image that I had scanned and then converted to PDF.
tamimym
  • 7,899
771
votes
21 answers

How can I extract a page range / a part of a PDF?

Do you have any idea how to extract a part of a PDF document and save it as PDF? On OS X it is absolutely trivial by using Preview. I tried PDF editor and other programs but to no avail. I would like a program where I select the part that I want and…
user72469
  • 7,719
768
votes
40 answers

How do I remove old kernel versions to clean up the boot menu?

Every time I install a new Linux kernel, it gets left in the grub_config, making the boot menu longer each time. I know I can manually search through the installed packages and remove them. Does Ubuntu provide any easier way to clean them up or…
763
votes
9 answers

Change folder permissions and ownership

I would like the user to have full rights on this folder (as well as all sub-directories and files in it): ~/.blabla currently owned by root. I have found numerous posts (in this forum and elsewhere) on how to do this for files but I can't find a…
user2413
  • 14,337
760
votes
10 answers

How to run scripts on start up?

How can I run scripts automatically when Ubuntu starts up so I don't have to run them manually after startup?
myusuf3
  • 34,189
756
votes
11 answers

How do I find the package that provides a file?

Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is. Bonus question: what if it's a…
David Z
  • 10,301
754
votes
47 answers

What should I do when Ubuntu freezes?

All operating systems freeze sometimes, and Ubuntu is no exception. What should I do to regain control when... just one program stops responding? nothing at all responds to mouse clicks or key presses? the mouse stops moving entirely? I have an…
ændrük
  • 76,794
739
votes
9 answers

What is the correct way to completely remove an application?

I've searched the net for such information and found different command lines, like these ones: sudo apt-get remove application sudo apt-get remove application* sudo apt-get remove --purge application sudo apt-get remove --purge application* sudo…
user48949
  • 7,833