Unix administration - checkign filesystems of current path

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > January 2004 > checkign filesystems of current path





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author checkign filesystems of current path
yls177

2004-01-23, 4:53 pm

example, i am in prompt myserver#/var/adm]

i wanted to find out which filesystem the current path is so i wanted
to do something like df -kt 'echo $pwd'. but it doesnt work. there are
alternatives like df -kt "type in the current path" or df -kt | grep
"current path". basically, i think i need to know how to parse a
builtin command so that it can be passed to another command as input.
Chris F.A. Johnson

2004-01-23, 4:53 pm

On Thu, 13 Nov 2003 at 07:17 GMT, yls177 wrote:
quote:

> example, i am in prompt myserver#/var/adm]
>
> i wanted to find out which filesystem the current path is so i wanted
> to do something like df -kt 'echo $pwd'. but it doesnt work. there are
> alternatives like df -kt "type in the current path" or df -kt | grep
> "current path". basically, i think i need to know how to parse a
> builtin command so that it can be passed to another command as input.



What shell are you using?

Some shells have a variable, $PWD, that contains the current
directory, in which case you can do:

df -kt "$PWD"

If not, there is a standard command, pwd, which will give you the
information. You can use the output of pwd as an argument to df by
using command substitution:

df -kt "`pwd`"

--
Chris F.A. Johnson http://cfaj.freeshell.org
========================================
===========================
My code (if any) in this post is copyright 2003, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Michael Vilain

2004-01-23, 4:53 pm

In article <bovbt0$1hk4bm$1@ID-210011.news.uni-berlin.de>,
"Chris F.A. Johnson" <c.fa.johnson@rogers.com> wrote:
quote:

> On Thu, 13 Nov 2003 at 07:17 GMT, yls177 wrote:
>
> What shell are you using?
>
> Some shells have a variable, $PWD, that contains the current
> directory, in which case you can do:
>
> df -kt "$PWD"
>
> If not, there is a standard command, pwd, which will give you the
> information. You can use the output of pwd as an argument to df by
> using command substitution:
>
> df -kt "`pwd`"



what's wrong with

df -kt .

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Chris F.A. Johnson

2004-01-23, 4:53 pm

On Thu, 13 Nov 2003 at 08:22 GMT, "Michael Vilain <vilain@spamcop.net>" wrote:
quote:

> In article <bovbt0$1hk4bm$1@ID-210011.news.uni-berlin.de>,
> "Chris F.A. Johnson" <c.fa.johnson@rogers.com> wrote:
>
>
> what's wrong with
>
> df -kt .



Mostly that it doesn't work on any system I've tried it on.

But neither do the solutions I posted.

man df:

-t type
Report on filesystems of a given type (for example, nfs
or 4.2).

Leave out the -t option and yours is the best way (says I,
slapping myself on the forehead and saying, "It's bedtime!")

--
Chris F.A. Johnson http://cfaj.freeshell.org
========================================
===========================
My code (if any) in this post is copyright 2003, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
yls177

2004-01-23, 4:53 pm

"Chris F.A. Johnson" <c.fa.johnson@rogers.com> wrote in message news:<bovhah$1ij3jc$1@ID-210011.news.uni-berlin.de>...
quote:

> On Thu, 13 Nov 2003 at 08:22 GMT, "Michael Vilain <vilain@spamcop.net>" wrote:
>
> Mostly that it doesn't work on any system I've tried it on.
>
> But neither do the solutions I posted.
>
> man df:
>
> -t type
> Report on filesystems of a given type (for example, nfs
> or 4.2).
>
> Leave out the -t option and yours is the best way (says I,
> slapping myself on the forehead and saying, "It's bedtime!")




thanks for posting.. your commands do work..

mine too :D df -kt `pwd` !

in `pwd` , this `` is used to parse the command?




also, i have this alias bkbin which changes to /my/bin/

now in my /my/bin, i have a subdirectory myhome, so that makes up /my/bin/myhome/

now i am in /tmp, i can do a
1) bkbin
2) cd myhome

however, i wanted to do this bkbin/myhome, but fails....

any comments?
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com