LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-07-2012, 02:47 PM   #1
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Lightbulb An alias file to resolve a minor annoyance.


In the newer Fedora distributions, there are several "irrelevant" (from a simple user's point of view) file systems mounted (i.e., sysfs, devtmpfs, tmpfs, selinuxfs, cgroup, etc.). This means that a simple "mount" command to check what's mounted is somewhat tedious to read. So I wrote a coupe of simple alias definitions like this:
Code:
$ cat /etc/profile.d/bash_alias.sh
alias mounted='mount | grep -v ^[^/]'
alias Mounted='mounted | gawk '\''{split($0,part,/ (on|type) /);print part[2]'\''}'
The first alias (mounted) just strips out all the lines in the mount command that don't start with a slash (/) character.

The second alias (Mounted) lists all the active mounts by mount-point.

Here's what the output looks like:
Code:
$ mounted
/dev/md0 on / type ext4 (rw,relatime,seclabel,user_xattr,acl,barrier=1,data=ordered)
/dev/sdb5 on /Persistant type ext4 (rw,relatime,seclabel,user_xattr,acl,barrier=1,data=ordered)
/dev/sdb6 on /BTRFS type btrfs (rw,relatime,seclabel,nospace_cache)
//Office/Public on /Samba/Public type cifs (rw,relatime,sec=ntlm,unc=\\Office\Public,username=Peter)
//Office/S on /Samba/S type cifs (rw,relatime,sec=ntlm,unc=\\Office\S,username=Peter)
//Office/U on /Samba/U type cifs (rw,relatime,sec=ntlm,unc=\\Office\U,username=Peter)
//Office/Users on /Samba/Users type cifs (rw,relatime,sec=ntlm,unc=\\Office\Users,username=Peter)
//Office/Books on /Samba/Books type cifs (rw,relatime,sec=ntlm,unc=\\Office\Books,username=Peter)
//Office/Documents on /Samba/Documents type cifs (rw,relatime,sec=ntlm,unc=\\1Office\Documents,username=Peter)
//Office/FEBE on /Samba/FEBE type cifs (rw,relatime,sec=ntlm,unc=\\Office\FEBE,username=Peter)
/BTRFS/ISO/Storm from the Shadows.iso on /mnt/ISO/Storm from the Shadows type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/The Best of Jim Baens Universe.iso on /mnt/ISO/The Best of Jim Baens Universe type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/The Claws that Catch.iso on /mnt/ISO/The Claws that Catch type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/The Spider.iso on /mnt/ISO/The Spider type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/This Scepter'd Isle.iso on /mnt/ISO/This Scepter'd Isle type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/Unto the Breach.iso on /mnt/ISO/Unto the Breach type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/When the Tide Rises.iso on /mnt/ISO/When the Tide Rises type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/Windrider's Oath.iso on /mnt/ISO/Windrider's Oath type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/1635 - The Eastern Front.iso on /mnt/ISO/1635 - The Eastern Front type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/Cryoburn.iso on /mnt/ISO/Cryoburn type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)
/BTRFS/ISO/Invasion.iso on /mnt/ISO/Invasion type iso9660 (ro,relatime,uid=0,gid=0,mode=0555)

$ Mounted
/
/Persistant
/BTRFS
/Samba/Public
/Samba/S
/Samba/U
/Samba/Users
/Samba/Books
/Samba/Documents
/Samba/FEBE
/mnt/ISO/Storm from the Shadows
/mnt/ISO/The Best of Jim Baens Universe
/mnt/ISO/The Claws that Catch
/mnt/ISO/The Spider
/mnt/ISO/This Scepter'd Isle
/mnt/ISO/Unto the Breach
/mnt/ISO/When the Tide Rises
/mnt/ISO/Windrider's Oath
/mnt/ISO/1635 - The Eastern Front
/mnt/ISO/Cryoburn
/mnt/ISO/Invasion
 
Old 03-08-2012, 11:56 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Nice but I'd say "simple users" have no reason to be checking mounts anyway. To them it is all "just directories" - they don't need to know the filesystem boundaries generally.
 
Old 03-08-2012, 01:17 PM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Perhaps, but I find it useful, and I'm a fairly simple user.

Oh, thinking about this thread, here better version of the Mounted alias:
alias Mounted='gawk '\''/^\//{print gensub("\\\\040"," ","g",$2)}'\'' /etc/mtab
 
  


Reply

Tags
alias


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Need assistance with a minor KDE annoyance to disable please! barnac1e Linux - Desktop 4 02-10-2012 09:40 PM
[SOLVED] Minor (really!) KDE 4.5.x Annoyance tronayne Slackware 4 06-27-2011 11:13 AM
Minor Samba Annoyance hongman Linux - Networking 3 03-28-2005 09:46 AM
minor icon annoyance in Apollon amishdisco Linux - Software 2 03-08-2004 01:48 PM
PHP - GD (minor annoyance) Wonko the Sane Programming 0 12-13-2003 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration