Ubuntu: Helpful Commands

To view the disk space usage:

du -sh

View hardware details of CPU:


View hardware details of RAM:

sudo dmidecode -t memory | more

Check how much memory is free (RAM as well as Swap area):

free -m

The output will be in MB. Simply use the -b, -k and -g switches for the result in bytes, kilobytes and gigabytes respectively.

Find out how many core is your processor:

sudo grep -c processor /proc/cpuinfo

More hardware commands:

cat /proc/version
file /sbin/init
uname -r
uname -m
getconf -a | grep KERN
getconf -a
getconf -a | more
uname -a
less /proc/cpuinfo

Combine images into a single PDF:

sudo apt-get install pdftk
pdftk 1.jpg 2.jpg 3.jpg 4.jpg cat output out.pdf

Extract selective pages from a PDF file:

pdftk A=orignial.pdf cat A271-280 output extracted.pdf

Mount dmg images:

dmg2img data.dmg data.img
sudo mount -t hfsplus -o loop data.img /mnt

Format Partitions or USB as FAT in Linux:

sudo mkfs.vfat -I /dev/sdc

The -I switch will force the partitioning


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s