Linux Cheat Sheet


  • Update our packages:   yum -y update
  • Install a package (mongo): yum -y install mongodb-org mongodb-org-server
  • Add a repository:
    • vim /etc/yum.repos.d/mongodb.repo
      name=MongoDB Repository

References:  How to Install MongoDB on Fedora 21

Mounting a partition:

  • List of mounted filesystems:
  • Definitive list:   /proc/mounts
  • Mounted filesystems: /etc/mtab
    (also used to configure mounting at boot time)
  • Disk space usage: df -H
  • Mount a file system:
    mkdir /media/newhd
    mount /dev/sdb1 /media/newhd
  • Unmount a file system
    umount /media/newhd
    umount /dev/sdb1

File Operations

  • Bulk file copy, using rsync.  rsync provides check points, restarts, and is faster and more reliable than the recursive cp command.
    • v: increase verbosity
    • a: apply archive settings to mirror the source files exactly, including symbolic links and permissions
    • P: presrve permissions
      rsync -avP src/ dst/