Sunday, 3 February 2013

How To Find Out Where Hard Drive Space Has Gone - Ubuntu

The default file manager for Ubuntu doesn't give users the possibility to see how much space a folder or subfolder takes up. You may use third-party software to see which folders that take up most space in your hard drive, or simply use the terminal to scan for big size folders to see where hard disk space has gone.

To do this, we need first to install the ncdu package (ncurses disk usage viewer & analyzer) with this command:

sudo apt-get install ncdu

To scan the root folder, run now this command:

ncdu /

The scan process may take several minutes to finish depending on the size of your hard drive. The returned output will be sorted by size.




To scan the home folder, run this command:

ncdu

To scan a specific folder, use this command:

ncdu /var

 
BE CARE FULL  ........... YOU WORKING WITH WORKING HDD.

How to Record Terminal Commands and their Returned Outputs in Ubuntu Linux

In this tip we will see how to record all commands executed in the terminal along with returned outputs to a text file automatically. This may help you better troubleshoot your problems, and can be very helpful in forums to better describe your issue.

Getting Started

Open the terminal and run this command to start a session:

script file.txt

You can rename "file.txt" to whatever you want. The session is now started. All commands entered and returned outputs will now be recorded into the text file automatically. This file will be saved in the current folder. To stop recording, press CTRL+D. To continue recording in the same file, use this command:

script -a file.txt

You can view the file using Gedit or any other text editor. Or you can view it via the terminal with this command:

cat file.txt

 [NOTE]: This tip is workable under Ubuntu and other Linux-based distributions.

How To Convert A Man Page For A Terminal Command Into A PDF File - Ubuntu

Man pages are help pages that give information about commands you run via the terminal. To have information, for example, about the "sudo" command, you can simply run this command via the terminal:

man sudo 

A help page will be displayed in the terminal for the "sudo" command. In this tip we will help you convert these man pages to PDF so that you can easily read and scroll them via your PDF reader under Ubuntu or any other Linux-based distribution.

If we want, for example, to convert the man page for the "sudo" command to PDF, run simply this command via the terminal:

man -t sudo | ps2pdf - sudo.pdf

Replace sudo with any command of your choice. The sudo.pdf file will be generated in the current terminal location. Here are some other examples:

man -t tee | ps2pdf - tee.pdf

man -t apt | ps2pdf - apt.pdf



How To Protect Files / Folders From Being Deleted Under Ubuntu

We sometimes need to protect some files or folders from being deleted by accident by you or users sharing your computer. Protecting your files or folders will also help you disallow unauthorized users to delete your sensitive contents.

To do this, we may use system encryption software, but changing just file/folder user access permissions will be enough to protect them. For example, chattr is a command line utility that allows via the terminal to change file or folder permissions.


  • Protecting Files

Open the terminal and run this command to protect any file of your choice from being deleted:

sudo chattr +i filename

Replace filename with your own. To remove this protection, run this command:

sudo chattr -i filename

  • Protecting Folders

To protect a folder from being deleted, use this command:

sudo chattr -R +i foldername

To unprotect the folder, use this command:

sudo chattr -R -i foldername


Protect files and Folders , it's sensitive.

BE CAREFULLY

BEST OF LUCK  ..............

How To Open A Specific Port Under Ubuntu From The Terminal

In this tutorial we will show you how to open ports in Ubuntu. This will be helpful when installing some applications and tools that require to open certain ports to run smoothly.

You can use a firewall frontend with GUI (Firestarter) to open ports in Ubuntu, but in this guide we will see how to do it via the terminal.

Getting Started 

Open the terminal (Ctrl+Alt+T) and run this command (root privileges is required):

sudo iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 8289 -j ACCEPT

Replace 8289 with the port you want to open.


Be CareFull Before open the port.
Run proper iptables .

BEST OF LUCK.

How To Check Dependencies Of Installed Packages Under Ubuntu

In this tip we will learn how to check dependencies of an installed package under a Ubuntu system. This will help you discover the programs and libraries used by the package in question. This tip is only workable for installed packages.

Open the terminal and run the following:

apt-cache depends package-name

Replace package-name with your own package name. Here is an example:

apt-cache depends nautilus

Here is a sample of the outputs returned for this example:

~$ apt-cache depends nautilus
nautilus
  Depends: libatk1.0-0
  Depends: libc6
  Depends: libcairo-gobject2
  Depends: libcairo2
  Depends: libdbusmenu-glib4
  Depends: libexempi3
  Depends: libexif12
  Depends: libgail-3-0
  Depends: libgdk-pixbuf2.0-0
  Depends: libglib2.0-0
  Depends: libgnome-desktop-3-2
  Depends: libgtk-3-0

That's it

How to Free up Unused Memory in Ubuntu / Linux

In this tutorial, we will see how to use the terminal to clean up unused memory that was not released properly after being used by your system. No need to use any third-party software, just a few commands will do the job pretty easily.

Check Memory Usage in Real-Time

You can check your current memory usage using this command:


watch -n 1 free -m



This command will also display in real-time your system memory usage:

watch -n 1 cat /proc/meminfo

In the returned outputs, focus on these memory details:

  • MemTotal:        1027104 kB
  • MemFree:          302836 kB
  • Buffers:           24212 kB
  • Cached:           297364 kB
  • SwapCached:            0 kB
  • Active:           478336 kB
  • Inactive:         164844 kB
Free Up Unused Memory

   Command 1

You can free up unused memory under Ubuntu/Linux Mint using this command:

sudo sysctl -w vm.drop_caches=3

NOTE: this action won't make your system faster nor it will affect its stability and performance, it will just clean up memory used by the Linux Kernel on caches.

   Command 2

Here is another command that can help you free up memory either used or cached (page cache, inodes, and dentries):

sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches

NOTE: You can use cron jobs to schedule the commands above to run at specific time intervals.

If you have more useful commands for releasing/flushing memory in Ubuntu/Linux Mint, use the comment form below

How To Delete Only A Specific File Extension Inside A Directory - Ubuntu/Linux

If you use frequently the terminal under Ubuntu to delete files and want an easy method for deleting a specific file extension, then this tip might be useful for you. The command we will see consists of deleting a specific file format stored in a directory, the file extension in question will be also deleted from other sub-folders.

Using this command will surely save you a lot of time. To do this we will use the "find" command. Open the terminal and run this command:

find directory-name *.bmp -delete

Replace bmp with your own file extension you want to delete (mp3, doc, txt, wav, mp4, etc.).

The selected file extension will be removed from the parent directory and all its sub-directories, so be careful when using this command to avoid deleting necessary files.

How to Clear/Erase Disk Partitions From The Terminal - Ubuntu / Linux

In this tip we will see some commands that allow users to erase (blank) a disk partition or any other external disk via the terminal under Ubuntu / Linux. Before starting, you should know that we are not liable for any misuse of these commands, you have to execute them very carefully to avoid deleting accidentally your main system disk (the disk hosting the OS).

There are many commands for listing information about system installed hard drives and partitions, here are some of them:

cat /proc/partitions

sudo fdisk -l

sudo parted /dev/sda print

df -h

Getting Started

The first command for erasing a disk consists of using the dd Linux / Unix command. After deciding which partition or external disk you want to erase, open the terminal and run this command:

sudo dd if=/dev/urandom of=/dev/sdaX

Or, you can zero all disk data with this command:

sudo dd if=/dev/zero of=/dev/sdaX

    - Note: Replace sdaX with your own disk name (sda2, sda3, etc.).

The next command consists of using the shred command line tool. You can erase a disk with this command:

sudo shred --iterations=3 /dev/sdaX

Grant Other Users Permission To Run The 'sudo' Command - Ubuntu

Under Ubutnu, we use the "sudo" command to allow some users or a group of users to run a command with root (administrator) privileges. To grant a user the possibility to run "sudo" commands under Ubuntu, then follow these instructions:

Open the terminal and run this command:

sudo adduser username sudo

Replace username with the user you want to allow to run "sudo" commands. If the operation is successful, you will get this as outputs:

~$ sudo adduser upubuntu sudo
Adding user `upubuntu' to group `sudo' ...
Adding user upubuntu to group sudo
Done.

How to Delete Files / Non-Empty Directories using the Terminal in Ubuntu / Linux

In this tutorial, we will see briefly how to delete files or directories from the command line under Ubuntu or any other Linux-based system. The tutorial will be precisely about using the "rm" and "rmdir" command line utilities.

Warning: You have to be careful when using the "rm" command because any misuse may render your system unusable, so be warned!

1. Deleting Files

You can delete a file from the terminal using this command:

rm filename

If you are not in the current file location, then use this command:

rm /path/to/folder/filename

If you want to remove all files in a folder, then use this command:

rm /path/to/folder/*

If the file you want to delete requires root privileges, then precede your command with "sudo":

sudo rm filename

2. Deleting Directories

You can simply delete an empty directory with the following command:

rmdir foldername

If the directory contains files and sub-folders, then rmdir will not allow you to delete it. The solution is to use the "rm" command to delete a non-empty directory as follows:

rm -r foldername

For root access, precede the command with "sudo":

sudo rm -r foldername

I hope you find this tutorial useful!

How To Change / Reset Lost MySQL Root Password Under Ubuntu

In this tip we will see how to change or reset the MySQL root password under Ubuntu. This tip is tested under Ubuntu 11.10 and may work for other older versions of Ubuntu (11.04/10.10/10.04 or older).

This tutorial is also useful for users that forget to assign a MySQL root password during the installation of the MySQL client. If no password assigned, you may get this error when trying to login to the MySQL server:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Getting Started

1. Open the terminal (Ctrl+Alt+T) and stop the MySQL server with this command:

sudo /etc/init.d/mysql stop

2. Run now this command to start the MySQL configuration:

sudo mysqld --skip-grant-tables &

3. Login now to the MySQL server as root:

mysql -u root mysql

4. Change now your MySQL root password with this command:

UPDATE user SET Password=PASSWORD('NEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;

Replace NEWPASSWORD with any password of your choice.

You can now login smoothly to the MySQL server with the assigned password.

That's it!

How To Run Your SSH Server On Multiple Ports Under Ubuntu 12.04

In this tip we will see how to easily change the default SSH server port number and making it running on multiple ports under Ubuntu 12.04 or older. The default SSH port number is 22, changing it to a new port will help you avoid hackers' attack on this port. Installing an SSH server under Ubuntu can be done with the following command:

sudo apt-get install openssh-server openssh-client

To change now the SSH server port number, follow these instructions:

- Via the command line, edit this file:

sudo gedit /etc/ssh/sshd_config

- Search for Port 22 and make sure it is uncommented, then set your own port number:



- To run your SSH server on multiple port numbers, add each port in a new line as follows:

Port 22
Port 33
Port 847

- Press now CTRL+Q and save your file, then restart your SSH server with this command so that your changes take effect:

sudo /etc/init.d/ssh restart

or

sudo service ssh restart

- You can now test your ports by running this command:

ssh -p PORT_NUMBER localhost

Here is an example:

ssh -p 22 localhost

If you are required to submit a password, then your SSH server is listening to this selected port.

Note: this tip is also workable for Ubuntu 11.04/10.10/10.04.

Saturday, 2 February 2013

How To Find All Zero Byte Files (aka Zero Length File) Under Ubuntu / Linux

A zero byte file is a file that is placed in your hard drive with no data inside it. This means it has a size or length of zero bytes. If you want to list all zero byte files in a particular location in your hard drive under Ubuntu or any other Linux-based system, you can simply use the "Find" command line utility.

To scan for example the current terminal location for zero length files, you can use this command:

find -size 0

To scan a particular directory (the home directory for example), use this command:

find ~/ -size 0

To scan your root folder, use this command:

find / -size 0

What To Do After A New Installation Of Ubuntu 12.04 Precise Pangolin

Some readers contacted me about the possibility to write an article about things to do after a fresh installation of Ubuntu 12.04 Precise Pangolin. In fact, there are many things to do after a new installation of Ubuntu 12.04, but in this guide I will try to give you what is important. If you think we have missed something interesting for Ubuntu 12.04, please mention it in the comment form given below.

1. Updating Your Repositories

The first thing to do is to configure Ubuntu to download packages from main Ubuntu servers instead of location-based servers to avoid the notorious 404 error when installing packages from the terminal using the "apt-get install" command. To do this, start the terminal (Ctrl+Alt+T) and run this command:

    sudo software-properties-gtk


Make sure all options under "Downloadable from the internet" are checked on, then select Download from: Main server:


In the same window, open the "Other Software" tab and check on all unticked sources (Canonical, Independent, etc.):


Close the window and update now your repositories with these commands:

    sudo apt-get update

    sudo apt-get upgrade


2. Installing Hardware Drivers

Open the terminal and run this command:

    sudo jockey-gtk


In the window that appears, install proposed hardware drivers (wifi, keyboard, proprietary graphics card drivers, etc.):


If you own a high-end graphics card from Nvidia or AMD, you need to install the latest open-source driver to get better graphics support and performance. We have written many articles about the installation of Nvidia/AMD drivers in this blog. You can check them here.

3. Add Support For Double Layer DVD In Ubuntu 12.04

To be able to read Double Layer DVDs on Ubuntu 12.04, you need to install the libdvdcss2 package with these commands:

    sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list

    sudo apt-get --quiet update

    sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring

    sudo apt-get --quiet update

    sudo apt-get install libdvdcss2


4. Installing Multimedia Packages ( Ubuntu Restricted Extras)

Ubuntu needs some packages to be able to play certain audio/video format such as MP3, AVI, Mp4, etc. To install them, open the terminal and run this command:

    sudo apt-get install ubuntu-restricted-extras


5. Managing Unity & Desktop Visual Effects

If you need to do some modification for example on the launcher's icon size, transparency, backlights,  window decoration, add desktop 3d effects, and so on, the best choice is to use software like MyUnity and  Compiz Config Settings Manager. To install them on Ubuntu 12.04, run the following commands:

 - Compiz Config Settings Manager:


    sudo apt-get install compizconfig-settings-manager


 - MyUnity:



    sudo apt-get install myunity


6. Clean up Ubuntu With Ubuntu Tweak


Ubuntu Tweak is an application with GUI that allows users to view system device details (CPU, Memory, etc.) and clean up your system from junk files that are unnecessary. You can install it on Ubuntu 12.04 or older with the following commands:

    sudo add-apt-repository ppa:tualatrix/ppa

    sudo apt-get update

    sudo apt-get install ubuntu-tweak


8. Installing Oracle Java 7

To install Java 7 under Ubuntu 12.04, run the following commands from the terminal:

    sudo add-apt-repository ppa:upubuntu-com/java

    sudo apt-get update

    sudo apt-get install oracle-java7-installer


9. Adding Themes To Unity & Gnome Shell

If you want to install GTK+ themes for Unity/Gnome Shell, you can get many of them here. The Gnome Shell interface is installed by default in Ubuntu 12.04 (Precise Pangolin). If it is not the case, you can simply install it with this command:

    sudo apt-get install gnome-shell gnome-tweak-tool


 To enable this interface, logout the current session, select GNOME from the session menu, then log back in:


To install Gnome Shell themes (not GTK+themes) on Ubuntu 12.04, you can refer to this article. For Gnome Shell extensions, go to this website, or check this post that we have published recently containing many extensions for Gnome Shell 3.4. You can also find here a list of application indicators for Unity.

10. Download Manager

If you want to perform mass downloads with the ability to pause/resume file download, you can install on Ubuntu 12.04 the UGET download manager with this command:

    sudo apt-get install uget


11. Graphics Applications

There are many graphics applications you can use on Ubuntu 12.04. Here are some popular ones that you need to install:

- GIMP 2.8

    sudo add-apt-repository ppa:otto-kesselgulasch/gimp

    sudo apt-get update

    sudo apt-get install gimp gimp-plugin-registry gimp-resynthesizer


- Inkscape Vector Graphics Editor

    sudo apt-get install inkscape


- Pinta 1.2

    sudo add-apt-repository ppa:pinta-maintainers/pinta-stable

    sudo apt-get update

    sudo apt-get install pinta


12. Media Players

There are many other powerful media players other than Rhythmobox such as VLC, Clementine, SMPlayer, and Audacious.

- VLC Installation:

    sudo add-apt-repository ppa:videolan/stable-daily

    sudo apt-get update

    sudo apt-get install vlc


- Clementine Installation:

    sudo apt-get install clementine


- Audacious Installation:

    sudo apt-get install audacious


- SMPlayer Installation:

    sudo apt-get install smplayer


13. Video Editing Software

You can simply use the Openshot video editor:

    sudo apt-get install openshot openshot-doc


14. Bittorent Client

If you want to download torrent files, you can use Transmission. To install it on Ubuntu, run this command:

    sudo apt-get install transmission-gtk transmission-common


15. Chat & Communication Software

The best communication software for Ubuntu to stay in touch with your friends and family is Skype, aMSN, and Pidgin. You can install Skype 4.0 with these commands:

    sudo add-apt-repository ppa:upubuntu-com/chat

    sudo apt-get update

    sudo apt-get install skype


aMSk with this command:

    sudo apt-get install amsn


For Pidgin, run this command:

    sudo apt-get install pidgin


16. Install Windows Applications On Ubuntu 12.04

There are many emulators that allow to run Windows applications and games on Ubuntu. The most popular one is Wine. You can install it with these commands:

    sudo add-apt-repository ppa:ubuntu-wine/ppa

    sudo apt-get update

    sudo apt-get install wine1.5


17.  Virtualization Software

Your best friend here is VirtualBox which allows to install various operating systems under Ubuntu. You can install it with these commands:

    sudo sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian precise contrib' >> /etc/apt/sources.list"

    wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

    sudo apt-get update

    sudo apt-get install virtualbox-4.1


18. Installing More Web Browsers

If you want to use more than one web browser, you can install Google Chrome or Opera.

- Google Chrome:

    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

    sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

    sudo apt-get update

    sudo apt-get install google-chrome-stable


- Opera:

    wget -O - http://deb.opera.com/archive.key | sudo apt-key add -

    sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" > /etc/apt/sources.list.d/opera.list'

    sudo apt-get update

    sudo  apt-get  install opera


19. Installing A Web Server

If you are web developer, you can simply use the LAMP web server on Ubuntu. A tutorial here explains its installation on Ubuntu 12.04.

20. Synaptic Installation

Synaptic is no longer available in Ubuntu 12.04. This tool allows to easily install, remove, and upgrade Ubuntu packages. If you want to restore it, you can simply install it with this command:

    sudo apt-get install synaptic

Run "apt-get update" and "apt-get upgrade" in one ommand

In this tutorial, we will see two methods that will allow us to combine two frequently used terminal commands in a single command under a system running Ubuntu/Linux Mint. We will help you run "apt-get update" and "apt-get upgrade" with one command called "update", which will be easier to write and will save you time.

Method 1

Open the terminal (CTRL+ALT+T) and run this command:

 > ~/.bash_aliases; gedit ~/.bash_aliases

For Linux Mint, run this command:

 > ~/.bash_aliases; pluma ~/.bash_aliases

Add now these lines:

alias update='sudo apt-get update; sudo apt-get upgrade'


Save your file and close it, then restart your terminal by closing and opening it again. You can now run two commands using this one:

update

Method 2

Open the terminal and run this command:

sudo gedit /usr/local/bin/update

For Linux Mint, run this command:

sudo pluma /usr/local/bin/update

Add now this line:

sudo apt-get update; sudo apt-get upgrade


Save your file and exit, then give execution permission to this file with this command:

sudo chmod +x /usr/local/bin/update

Run now this command to test your script:

update

I hope you find this tip useful!

Archey: Display Distribution Logo And System Information On The Terminal - Ubuntu/Linux Mint/Debian

Archey is a tool written in Python that allows users to preview system information along with your Linux distribution logo on the terminal. In this tutorial we will help you install it on Ubuntu, Linux Mint and Debian.

Archey Installation

Let's firstly install some dependencies with this command:

 sudo apt-get install scrot lsb-release 

Install now Archey with these commands:

cd /tmp
wget -O archey-0.2.8.deb http://goo.gl/a9ku4
sudo dpkg -i archey-0.2.8.deb

Start now Archey with this command:

archey

For Ubuntu, you will get this:


If you want to start Archey automatically once you launch the terminal, then do the following:

- Edit .bashrc with this command:

sudo gedit ~/.bashrc

For Linux Mint:

sudo pluma ~/.bashrc

- At the end of the file, add these two lines:

# Archey
archey

- Save your file and exit, then open a new terminal window to test Archey.

Archey Home Page

20 Useful Terminal Commands and Tools that you May Need in Ubuntu/Linux Mint

Terminal is a text-based interface that grants users direct access to the UNIX system. You can use Terminal to run some specific commands, create files/folders, change system settings, and any other features that aren't available via programs with GUI.

In this article, I have collected 20 tools and commands that can be useful for Ubuntu/Linux Mint users. If you have more interesting commands or tools, you can mention them below.

1. Make An ISO From A Folder

If you want to make an iso file from a directory containing other files and sub-directories via the terminal, you can use the following command:


mkisofs -o image.iso -R /path/to/folder/

If you wish to backup the home folder, use this command:

mkisofs -o image.iso -R $HOME

2. Remove Non-Empty Folder

To remove a non-empty folder from the command line, you can use this command:

rm -rf /path/to/folder/

3. Checking Current CPU Architecture (32-bit or 64-bit)

To list your processor architecture in Ubuntu/Linux Mint, use one of these commands:

uname -m

or

arch

or

 file /bin/bash | cut -d' ' -f3

4. Generate Random Passwords

To generate random passwords via the terminal, you can use the following commands:

   a - makepasswd

makepasswd is a command line tool for generating passwords in Ubuntu/Linux Mint. Install it with this command:

 sudo apt-get install makepasswd

To generate a password with 20 characters, enter this command:

makepasswd --chars=20

b- OpenSSL

You can also use OpenSSL to generate random passwords using this simple command:

openssl rand -base64 20

5. Check Uptime

To check for how long your computer or laptop has been running since you powered it on, issue this command:

uptime

To monitor system uptime in real-time, use this command:

 watch -n 1 uptime

6. Check Information About Your Video Card

To list information about your graphics card (Nvidia, AMD, Intel, etc.), enter this command:

 lspci -v -s `lspci | awk '/VGA/{print $1}'`

7. Download And Extract Tar Files In One Command

If you want to extract an archive file after being downloaded in a single command, you can use the following command for tar files:

 wget URL-To-TAR-File -O - | tar xfz -

Here is an example:

 wget http://garr.dl.sourceforge.net/project/multibootusb/MultiBootUSB_4.7.tar.gz -O - | tar xfz -

8. Block/Unblock Wifi/Bluetooth

To disable wifi or Bluetooth in Ubuntu/Linux Mint, we can simply use the rfkill command line tool. To deactivate wifi, enter this command:

rfkill block wlan

For Bluetooth:

rfkill block bluetooth

To unblock WiFi, enter this command:

rfkill unblock wlan

For Bluetooth:

rfkill unblock bluetooth

9. Check CPU Temperature

To get the current temperature of your processor, issue this command:

acpi -t

To check CPU temp in real-time, run this command:


watch -n 1 acpi -t

10. Change Read Speed Of A CD/DVD

Let's first get the maximum read speed of your optical drive with this command:

eject -X

To increase/decrease read speed of a CD/DVD inserted into your optical drive, enter this command followed by the desired speed:

 eject -x 4

For more than one optical disc drive, use this command:

 eject /dev/cdrom -x 4

11. Check RAM Speed

To check memory speed from the command line, run this command:

 sudo dmidecode -t 17 | awk -F":" '/Speed/ { print $2 }'

12. Read/Write Speed Of A Hard Disk

To check read/write speed of your hard drive on the terminal, use this command:

sudo hdparm -tT /dev/sda

13. Monitor Network Usage

IPTraf is a command line utility that allows to monitor network activities in real-time. Install it in Ubuntu/Linux Mint with this command:

 sudo apt-get install iptraf

Start monitoring using this command:

sudo iptraf

14- Downloading Websites

If you want to download an entire website via the terminal, enter this command:

 wget --recursive  --page-requisites --convert-links www.domain.com

15. Check Gmail Unread Messages

To check for unread messages in your Gmail account, use this command:

curl -u GMAILUSER --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if //; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'

16. Monitor HDD Temperature

Use hddtemp to monitor hard disk temperature on the terminal. Run these commands:

sudo apt-get install hddtemp 
sudo hddtemp /dev/sda

17. Force Kill Apps

To force close an unresponsive software, run xkill from the terminal then click the software's window to close it.

18. Screen Recording

To capture your screen and record it in a video, use ffmpeg:

sudo apt-get install ffmpeg 
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq output.mpg

19. Check Current Kernel Version

You can simply use this command:

uname -r

20. Dtrx

The dtrx tool allows to extract most archive files without the hassle of memorizing the various extraction commands. To install it, run this command:

sudo apt-get install dtrx

Here are some examples:

dtrx file.zip 
dtrx file.tar.gz 
dtrx file.7z