Sponsored Content
Full Discussion: Findout path
Top Forums Shell Programming and Scripting Findout path Post 302539455 by KenJackson on Sunday 17th of July 2011 05:49:08 PM
Old 07-17-2011
The question isn't clear.

If you want to find the current directory, the pwd command will give it.

If you want to know if a path exists and is a directory, you can test it something like this (note that you probably mean /usr/, not /user/):
Code:
#!/bin/sh
DIR=/usr/bin/perl
if [ -d "$DIR" ]; then
    echo "Yes, $DIR is a directory"
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Findout Idle Time Setting

Hi Guru's, How do I find and set the login idle time setting in HP-UX 32? Thanks in advance, Mani (1 Reply)
Discussion started by: jvmani
1 Replies

2. UNIX for Dummies Questions & Answers

Command to findout the current shell?

Hi, Can you please tell me if there is anyway we can findout which shell we are using (is there any command?) Many thanks, (5 Replies)
Discussion started by: Aceform
5 Replies

3. Solaris

Findout 3rd party softwares in Linux/Solaris server

Hi all, how to find 3rd party softwares like Oracle,phpldapadmin,Citrix etc (other than packages) which are installed on a linux box. Please guide me to get this info'n on LINUX/SOLARIS. Thanks in advance, Uday (0 Replies)
Discussion started by: uday123
0 Replies

4. UNIX for Dummies Questions & Answers

How to findout the creation date?

Hi all Is ther anyway I can findout the date on which a file was created??? Regards Sube (3 Replies)
Discussion started by: sube
3 Replies

5. HP-UX

GCC version findout

Hi, In unix box GCC installed under the /usr/local/bin/gcc, i want to know the version of GCC. Could you please let me know the process for that. Thanks & Regards, Suji (1 Reply)
Discussion started by: srujana
1 Replies

6. UNIX for Advanced & Expert Users

how to findout the file system type?

Hi all, How to findout the file sytem type which is NFS and which is Local? Suppose i have 5 different folders my in Root directory. dir 4 and 5 are mounted on different file system and dir 1,2 and 3 are mounted on different fild system Now i wanted know which file sytem is Local and which... (1 Reply)
Discussion started by: psiva_arul
1 Replies

7. Linux

Findout iLO type installed in a machine

I have to write Linux script to findout what kind of ilo is been installed in the given ip address either ilo/LO100 or no device found. IP address will be given in the command line of the script. -> With out log on to the ip address, should get the ilo type installed in that machine. 1. I... (1 Reply)
Discussion started by: skmdu
1 Replies

8. UNIX for Dummies Questions & Answers

How to findout the files which are created after 12AM in unix server

Hi Friends, I want to get the list of the files which are created after 12AM in the server. Please help me on this to write a script. Thanks Sreenu. (1 Reply)
Discussion started by: sreenu80
1 Replies

9. AIX

How to reduce and findout CPU usage?

Frequently i am getting "total CPU is now 100.00%, which is above the error threshold (90%)" this error . (3 Replies)
Discussion started by: ranjithm
3 Replies

10. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies
mvdir(1M)																 mvdir(1M)

NAME
mvdir - move a directory SYNOPSIS
dir newdir DESCRIPTION
moves one directory tree into another existing directory (within the same file system), or renames a directory without moving it. dir must be an existing directory. If newdir does not exist but the directory that would contain it does, dir is moved and/or renamed to newdir. Otherwise, newdir must be an existing directory not already containing an entry with the same name as the last pathname component of dir. In this case, dir is moved and becomes a subdirectory of newdir. The last pathname component of dir is used as the name for the moved directory. refuses to move dir if the path specified by newdir would be a descendent directory of the path specified by dir. Such cases are not allowed because cyclic sub-trees would be created as in the case, for example, of which is prohibited. does not allow directory to be moved. Only users who have appropriate privileges can use EXTERNAL INFLUENCES
International Code Set Support Single- and multi-byte character code sets are supported. AUTHOR
was developed by OSF and HP. SEE ALSO
cp(1), mkdir(1), mv(1). STANDARDS CONFORMANCE
mvdir(1M)
All times are GMT -4. The time now is 11:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy