Sponsored Content
Full Discussion: Get mountpoint from filename
Top Forums Shell Programming and Scripting Get mountpoint from filename Post 302512958 by cgkmal on Tuesday 12th of April 2011 03:22:48 AM
Old 04-12-2011
Hi karelb,

For a path like your sample you can try:

Code:
echo "/a/b/c/d/file.txt" | awk -F"/" '{print "/" $2"/"$3}'
/a/b

Regards
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

HPUX : identify NFS mountpoint

Is there a way to identify a directory as the start of an NFS mountpoint in HPUX 11.0? Using existing utilities & without root priv. If you stat the directory and use the S_ISNWK macro you can find network special files that way. The requirement will have to go through other channels if I need... (5 Replies)
Discussion started by: jim mcnamara
5 Replies

2. Solaris

problem in restoring mountpoint in Solaris

Hi, I am restoring the existing mount point on Solaris and getting below mentioned error mount: /dev/dsk/c0t2d0s6 is already mounted or /billing is busy I uses truss command to see the output and snapshot is below. Please help me to restore the mount point, # truss -fa mount -F... (3 Replies)
Discussion started by: helplineinc
3 Replies

3. UNIX for Dummies Questions & Answers

Testing NAS /mountpoint accessible

Hello. What's the best way to ensure that a NFS filesystem mounted from a disk-cabine (NAS) is accessible? My proposal: 1. ping to the ip of the cabine 2. verify filesystem is mounted 3. touch a file inside the /mountpoint Any other suggestions? Thank you! (2 Replies)
Discussion started by: asanchez
2 Replies

4. UNIX for Advanced & Expert Users

Filesystem and partition, mountpoint

Hello All, I am new to System/plat-form administration work. Right now I am facing some issues while creating the filesystem and mounpoint. I am using Linux 6.0 SuSE 11. Last time I was used one command to partition the given space along with filesystem in SuSE 9 and it was done in GUI mode but... (0 Replies)
Discussion started by: nvkuriseti
0 Replies

5. AIX

read lv mountpoint information directly from disk

Hello, I need to get the lv mountpoint from the hdisk directly (from vgda i guess) and not from odm or /etc/filesystems I knew the command, but unfortunately I forgot it ;) cheers funksen (5 Replies)
Discussion started by: funksen
5 Replies

6. Solaris

Mountpoint 100% but no data inside

One of our mountpoint shows 100% but we have less data on that mountpoint. Pls help me to find which data/process holds the space. bash-3.00$ cd /oracle/server_software/oracle10 bash-3.00$ du -sh * 0K admin 260M app 0K flash_recovery_area 0K lost+found 0K oradata ... (6 Replies)
Discussion started by: rock123
6 Replies

7. UNIX for Advanced & Expert Users

Unable to format new mountpoint

Can some one help me i try to mkfs new mountpoint from storageIBM but give some problem # mkfs -t ext3 /dev/sdd1 mke2fs 1.39 (29-May-2006) /dev/sdd1 is apparently in use by the system; will not make a filesystem here! my os is redhat 5.3 using fdisk # fdisk -l Disk /dev/sda: 298.9... (4 Replies)
Discussion started by: vickyid04
4 Replies

8. AIX

Space not getting released on the mountpoint

root@atldc-oragrid-ux01:/oragrid_01> du -sg * 0.58 11gR2gridBase 47.31 Grid_11203 4.17 app 0.00 lost+found 0.01 oraInventory root@atldc-oragrid-ux01:/oragrid_01> cd Grid_11203 root@atldc-oragrid-ux01:/oragrid_01/Grid_11203> du -sg *|sort 0.00 JRE 0.00 OPatch_old 0.00 ... (11 Replies)
Discussion started by: Vishal_dba
11 Replies

9. Shell Programming and Scripting

Mountpoint monitoring script

Hi, I am new to shell scripting. I prepared a very simple script to monitor mount points but not geting desired output. df -h|awk -F' ' '{ if ($5 >= 80) print "CRITICAL\n" $NF " mount point has reached " $5;}'|sed -n '3,$p' When I run above script in Sun solaris box it is executing... (8 Replies)
Discussion started by: sv0081493
8 Replies

10. UNIX for Dummies Questions & Answers

Creating mountpoint in Linux from rawdevices without lv's

Hello, I need to create mountpoint in linux from rawdevices without using lv's. Please help me with the steps to do this. Best regards, Vishal (2 Replies)
Discussion started by: admin_db
2 Replies
HALEVT-MOUNT(1) 					      General Commands Manual						   HALEVT-MOUNT(1)

NAME
halevt-mount/halevt-umount - Mount or umount device through HAL SYNOPSIS
halevt-mount [options] [-w] mountpoint|device|udi halevt-mount [options] <-c | -r> <-a | mountpoint | device | udi> halevt-mount [options] <-l | -s> halevt-umount [options] < -a | mountpoint | device | udi> DESCRIPTION
halevt-mount Mount or umount device through HAL and keep a track of devices handled. When called as halevt-umount the default is to unmount, when called as halevt-mount the default is to mount. Option -c, -l, -r, -s or -w changes the operation performed. Additional argument is considered to be a mount point, a device or an udi when unmounting or removing. If the commands are not called with -s after changes in the state of the devices (after mounting, unmounting, removing devices), the infor- mation available for halevt-mount and halevt-umount may become out of sync with the state of the system. When run as user halevt (or as root), no uid= argument is passed to HAL when mounting, otherwise this option is passed, if the filesystem allows it. OPTIONS
-a When listing, list all the existing devices. For the other operations, perform the operation on all the handled devices. -c Remove the handled device. -d device Use device device. -f file Use file file to store information about the handled devices instead of the default. -h Help message and options summary. -i directory Use lock file and device information file in the directory directory (if they are not already specified). -l List handled devices. Formatted with, on each line, udi:device:mountpoint. -p mountpoint Use mountpoint mountpoint. -m umask Set mount umask to umask if run as a system user, and the filesystem supports it. -n file Use file file as lock file. -o option Add the option option to the mount call. -r Umount. -s Sync the information about the handled devices with the informations known by HAL. -u udi Use udi udi. -w Add to the handled devices. SEE ALSO
halevt(1), gnome-mount(1), pmount(1) VERSION
This is halevt-mount version 0.1.6.2. AUTHOR
Main author is Patrice Dumas pertusus at free dot fr. AVAILABILITY
The latest version of this program can be found at: http://www.nongnu.org/halevt/ COPYRIGHT
Copyright (C) 2007-2008 Patrice Dumas <pertusus at free dot fr>, There is NO warranty. You may redistribute this software under the terms of the GNU General Public License; either version 2 of the License, or (at your option) any later version. For more information about these matters, see the file named COPYING. 7th Edition HALEVT-MOUNT(1)
All times are GMT -4. The time now is 09:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy