What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags





Commands using mount from sorted by
Terminal - Commands using mount - 62 results
mount -t smbfs //$server/share /local/mount -o rw,username=$USER
2009-03-25 01:05:17
User: sufoo
Functions: mount

Mount an smb share with this command. other options -ousername=$USERr,gid=$groupname,scope=rw

mount | column -t
2009-03-20 14:18:56
User: thechile
Functions: column mount

Particularly useful if you're mounting different drives, using the following command will allow you to see all the filesystems currently mounted on your computer and their respective specs with the added benefit of nice formatting.

INFILE=/path/to/your/backup.img; MOUNTPT=/mnt/foo; PARTITION=1; mount "$INFILE" "$MOUNTPT" -o loop,offset=$[ `/sbin/sfdisk -d "$INFILE" | grep "start=" | head -n $PARTITION | tail -n1 | sed 's/.*start=[ ]*//' | sed 's/,.*//'` * 512 ]

Suppose you made a backup of your hard disk with dd:

dd if=/dev/sda of=/mnt/disk/backup.img

This command enables you to mount a partition from inside this image, so you can access your files directly.

Substitute PARTITION=1 with the number of the partition you want to mount (returned from sfdisk -d yourfile.img).

sudo mount -o remount,rw /
2009-03-01 13:36:05
User: blindgaenger
Functions: mount sudo
Tags: mount remount rw

Saved my day, when my harddrive got stuck in read-only mode.

mount -t proc{,,}
2009-02-26 12:53:58
User: alexfoo
Functions: mount

Run this in / in a chroot to get your own proc there.

function miso () { mkdir ~/ISO_CD && sudo mount -o loop "$@" ~/ISO_CD && cd ~/ISO_CD && ls; } function uiso () { cd ~ && sudo umount ~/ISO_CD && rm -r ~/ISO_CD; }
2009-02-25 03:41:35
User: vududevil
Functions: cd mkdir mount rm sudo umount

Add the functions to the .bashrc to make it work

Example: First go to the iso file directory and type:


user@box:~$ miso file.iso


It will put you into a temporary mounting point directory (ISO_CD) and will show the files

You can umount the iso file whatever the directory you are


user@box:~/ISO_CD$ uiso


It wil umount the iso file and remove the temporary directory in your home

mount -t cd9660 /dev/`mdconfig -a -t vnode -f discimg.iso` /cdrom
2009-02-19 06:31:14
User: mulad
Functions: mount

FreeBSD version of the Linux command

mount discimg.iso /cdrom -o loop

The "mdconfig" command creates a device and prints the name (typically "md0"). Just append that to "/dev/" and mount.

Once unmounted, you can unconfigure the device with

mdconfig -d -u 0

using "0" for md0, "1" for md1, etc.

mount -o -t ntfs-3g /dev/sda1 /mnt/windows/c force
2009-02-16 10:51:57
User: RonaldConco
Functions: mount

If you have the library installed ntfs-3g, you will be able to mount the windows partition and write on it....

mount -o auto -t ntfs /dev/hda1 /windows
2009-02-16 10:45:06
User: RonaldConco
Functions: mount

if the command is successful , you will get no output - only if an error has occurred will there be output

mount | grep : | tr -s ' ' -d 3 | xargs umount -v
mount -t tmpfs tmpfs /mnt -o size=1024m
2009-02-06 00:33:08
User: ajrobinson
Functions: mount

Makes a partition in ram which is useful if you need a temporary working space as read/write access is fast.

Be aware that anything saved in this partition will be gone after your computer is turned off.

mount /path/to/file.iso /mnt/cdrom -oloop
2009-02-05 17:28:06
User: nerd65536
Functions: mount
Tags: mount iso

"-o loop" lets you use a file as a block device