Fast yet simple way to navigate directories

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Fast yet simple way to navigate directories
# 8  
Old 04-27-2012
Interesting. Both BASH and KSH have that...
This User Gave Thanks to Corona688 For This Post:
# 9  
Old 04-27-2012
Good work!! Smilie

How does it act if we get multiple results for one search?

Example:
Code:
/var/log/mylog1
/var/log/mylog2
/var/log/mylog2

Code:
sc /var/log *log*

From the first look of the script, I dont think it's meant to handle such situations!!
This User Gave Thanks to admin_xor For This Post:
# 10  
Old 04-27-2012
Quote:
Originally Posted by Corona688
Interesting. Both BASH and KSH have that...
It is POSIX even:

Quote:
The following environment variables shall affect the execution of cd:

CDPATH
A <colon>-separated list of pathnames that refer to directories. The cd utility shall use this list in its attempt to change the directory, as described in the DESCRIPTION. An empty string in place of a directory pathname represents the current directory. If CDPATH is not set, it shall be treated as if it were an empty string.
[..]
cd: ENVIRONMENT VARIABLES
This User Gave Thanks to Scrutinizer For This Post:
# 11  
Old 04-27-2012
Quote:
Originally Posted by admin_xor
Good work!! Smilie

How does it act if we get multiple results for one search?

Example:
Code:
/var/log/mylog1
/var/log/mylog2
/var/log/mylog2

Code:
sc /var/log *log*

From the first look of the script, I dont think it's meant to handle such situations!!
Thanks, admin_xor.Smilie
If results for one search are more than one, this script will simply choose the first one. And in your case, it is
Code:
/var/log/mylog1

So if you want go to, say,
Code:
/var/log/mylog3

then you have to provide it with more specific information by typing
Code:
sc /var log/myl*3

or
Code:
sc /var log/mylog3


Last edited by IKE0000; 04-27-2012 at 11:26 PM.. Reason: misspelling
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Navigate to Windows Desktop?

I want to use my Desktop for saving files of my codes. Looking for Desktop in my OS (C : ) and couldn't find it anywhere. Is it possible to navigate to your desktop? If so how? By the way, I am using Cygwin. (6 Replies)
Discussion started by: DyslexicChciken
6 Replies

2. AIX

Do you need execute permission to navigate to a directory?

i have a user 'bart' which does not belong to apps group (as shown below) and i want him to be able to navigate to TEST directory.. i gave him read access but he cannot get through. when i added execute permission he was able to navigate to TEST drwxr-xr-- 3 draco apps 4096 Apr... (2 Replies)
Discussion started by: chipahoys
2 Replies

3. UNIX for Dummies Questions & Answers

help with simple unix file copy and output in directories

Hi, I am fairly new to unix, and am trying to copy all files with the name "*.cons" within a directory (and all of the many directories within it) to a new directory called "output". There are multiple nested directories, and I would like to just pull out the files with ".cons" and not the other... (5 Replies)
Discussion started by: euspilapteryx
5 Replies

4. Shell Programming and Scripting

script to navigate thrugh directories

Hi, I have a requiremnet where i need to apply logic on directories and sub-direcotories. Example: base="/a/b/c" base1="/a/b/c/d/e" subfolders in both base and base1 are same : es, ig, os var1=es var2=ig var3=os Now i have used the follwoing lines in my code and these are... (3 Replies)
Discussion started by: sussane
3 Replies

5. UNIX for Dummies Questions & Answers

How to navigate previous files one by one.

Hi can you tell me if i have opened no of files using vi editior then how can i navigate previous files one by one. Suppose i have opened five files using vi editor as below vi file1 file2 file3 file4 file5 and nom i am in the last file file5 then if i want to go to previous file file 4 and... (5 Replies)
Discussion started by: ajayshukla
5 Replies

6. UNIX for Dummies Questions & Answers

Viewing Directory Content as You Navigate Directories in UNIX

Hi, Can someone help me figure out how to view directory content while I navigate directories (without having to go to the actual directory and "ls-ing" it)? Is there some keyboard shortcut for this? For instance, it would be useful if I could see the content of a directory when I'm copying... (2 Replies)
Discussion started by: shelata
2 Replies

7. Shell Programming and Scripting

How Do I Navigate To A Directory???

I am trying to install some applications, on my linux OS and all the instructions are tell me that ill have to navigate to the directories and type the link that they provide, but i try typing 'dir' which shows me the directories but to access a particular one i can't remember how??? can anyone... (2 Replies)
Discussion started by: kprescod4158
2 Replies

8. UNIX for Dummies Questions & Answers

Can you navigate ABOVE the home directory?

Hello, How do I navigate to the level ABOVE the home directory? I have the following structure on my drive, bearing in my I'm using a cygwin port on Windows. C:\ C:\cygwin C:\cygwin\bin C:\cygwin\otherfolders C:\cygwin\home (the home directory) C:\cygwin\home\H (my user directory) ... (4 Replies)
Discussion started by: patwa
4 Replies

9. UNIX for Dummies Questions & Answers

changing directories (i'm sure there is a simple solution for this)

I just want to exit my script in a new directory from a bash shell. Problem is that the script internally changes to the directory I want to move to, however when exits is still in the original directory. Does that make sense? ie usage: goto null changing from /usr/bin/xtra/test/test3/ ... (8 Replies)
Discussion started by: Shakey21
8 Replies
Login or Register to Ask a Question