Get shell command return status / return code

Hello,

for everyone who wanted to know how to get the return code or status from an executed command in unix:

# for example use the ls command on a directory
ls -l /home

# get return code
echo $?

This returns an integer code as 0 or 1 or 127. Normally 0 means OK, 1 means ERROR and 127 means COMMAND NOT FOUND. Every command has its own return code but the 3 mentionned before are general.

exFAT support for Ubuntu

First of all, what is exFAT? exFAT is a newer version of the old FAT16 (16bit) and FAT32 (32bit) and is sometimes called FAT64. It removes the disturbing 4GB file limit which is given with FAT32 and introduces a recommended maximum partition size of 512TB although it could do 64ZB in theory. Let's be honest, it has its advantages but also its disadvantages. One big disadvantage is that it uses ONLY 1 allocation table whereas FAT16 and FAT32 uses backup tables to do data recovering in case of disc failure. if you want to know more about exFAT you can check out the wikipedia article.

Now let's come to implementation of exFAT in Ubuntu. Remember that this is still in beta but should generally be safe to use in production. So, now how to install it:

  • open terminal and type:
    # sudo add-apt-repository ppa:relan/exfat 
  • update the software catalog:
    # sudo apt-get update
  • install the exFAT-FUSE driver:
    # sudo apt-get install fuse-exfat

That's it. Mounting and unmounting is now quite easy:
# mount .exfat-fuse [source] [dest]

Replace source with your hard drive e.g. /dev/sdb1 and destination with the folder where de disk should be loaded.