Skip to content

Instantly share code, notes, and snippets.

@smbanaie
Last active August 29, 2015 14:01
Show Gist options
  • Save smbanaie/1c4c782e6e84a8322daf to your computer and use it in GitHub Desktop.
Save smbanaie/1c4c782e6e84a8322daf to your computer and use it in GitHub Desktop.
chmod u+x runnable file # user + Execute
chmod o+x runnable file # other + Execute
tar -xvf file.tar
# Show right version of java
file /etc/alternatives/java /etc/alternatives/javac
#Empty A File
cat /dev/null > ImageStore.log
#See Overall Storage
df
#see disk usage
du -h /tmp
#empty old kernel that caused /boot full
sudo apt-get purge $( dpkg --list | grep -P -o "linux-image-\d\S+" | grep -v $(uname -r | grep -P -o ".+\d") )
or
Type uname -r. This will show you the kernel you're using currently, so you don't want to remove this.
Run the following command: dpkg --list | grep linux-image. This will show the all the kernels that are installed.
Note down the names of all the kernels which you want to remove.
To remove the kernels, run: sudo apt-get purge linux-image-x.x.x.x-xyz (replace the kernel name with an appropriate one).
Update the GRUB: sudo update-grub2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment