Sponsored Content
Top Forums Shell Programming and Scripting How Do I Navigate To A Directory??? Post 302160007 by kprescod4158 on Saturday 19th of January 2008 10:55:34 PM
Old 01-19-2008
Error 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 help me A.S.A.PSmilie
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

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. Shell Programming and Scripting

Script That Can navigate to 3 differents directory & remove files under them

Hi I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ?? /logs logs1 logs2 logs3 Now I need to remove files under logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' . in... (3 Replies)
Discussion started by: Beginner123
3 Replies

6. 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

7. Shell Programming and Scripting

need to navigate into specified folder and delete the files

Hi all, I need to write a script to naviagate into the list of specified folder and delete the files in it. I have mentioned the list of folders in a external file so it can be reusable. The issue is am facing now is that, i am not understating on how to navigate into the folder locations... (6 Replies)
Discussion started by: Nithz
6 Replies

8. Red Hat

Fast yet simple way to navigate directories

If you are like me, typing CD command again and again would quickly get tiresome and wonder there must be a better way to do it. I have done some searching on Google and this forum. The results I get (using alias, CDPATH or PUSHD) do not satisfy me completely, so I decide to do it my way.... (10 Replies)
Discussion started by: IKE0000
10 Replies

9. UNIX for Dummies Questions & Answers

Need to navigate to HOME directory when I log in

Hi, Currently i'm logging as a user say atgdev. When I login it takes me to directory /. I see the home directory set as /home/atgdev/ I want that when i log in it shud directly go to my home directory i.e /home/atgdev/. I thought .profile in /home/atgdev/ will be invoked first when i log... (9 Replies)
Discussion started by: Gangadhar Reddy
9 Replies

10. 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
Template::Plugin::Directory(3)				User Contributed Perl Documentation			    Template::Plugin::Directory(3)

NAME
Template::Plugin::Directory - Plugin for generating directory listings SYNOPSIS
[% USE dir = Directory(dirpath) %] # files returns list of regular files [% FOREACH file = dir.files %] [% file.name %] [% file.path %] ... [% END %] # dirs returns list of sub-directories [% FOREACH subdir = dir.dirs %] [% subdir.name %] [% subdir.path %] ... [% END %] # list returns both interleaved in order [% FOREACH item = dir.list %] [% IF item.isdir %] Directory: [% item.name %] [% ELSE %] File: [% item.name %] [% END %] [% END %] # define a VIEW to display dirs/files [% VIEW myview %] [% BLOCK file %] File: [% item.name %] [% END %] [% BLOCK directory %] Directory: [% item.name %] [% item.content(myview) | indent -%] [% END %] [% END %] # display directory content using view [% myview.print(dir) %] DESCRIPTION
This Template Toolkit plugin provides a simple interface to directory listings. It is derived from the Template::Plugin::File module and uses Template::Plugin::File object instances to represent files within a directory. Sub-directories within a directory are represented by further "Template::Plugin::Directory" instances. The constructor expects a directory name as an argument. [% USE dir = Directory('/tmp') %] It then provides access to the files and sub-directories contained within the directory. # regular files (not directories) [% FOREACH file IN dir.files %] [% file.name %] [% END %] # directories only [% FOREACH file IN dir.dirs %] [% file.name %] [% END %] # files and/or directories [% FOREACH file IN dir.list %] [% file.name %] ([% file.isdir ? 'directory' : 'file' %]) [% END %] The plugin constructor will throw a "Directory" error if the specified path does not exist, is not a directory or fails to "stat()" (see Template::Plugin::File). Otherwise, it will scan the directory and create lists named '"files"' containing files, '"dirs"' containing directories and '"list"' containing both files and directories combined. The "nostat" option can be set to disable all file/directory checks and directory scanning. Each file in the directory will be represented by a Template::Plugin::File object instance, and each directory by another "Template::Plugin::Directory". If the "recurse" flag is set, then those directories will contain further nested entries, and so on. With the "recurse" flag unset, as it is by default, then each is just a place marker for the directory and does not contain any further content unless its "scan()" method is explicitly called. The "isdir" flag can be tested against files and/or directories, returning true if the item is a directory or false if it is a regular file. [% FOREACH file = dir.list %] [% IF file.isdir %] * Directory: [% file.name %] [% ELSE %] * File: [% file.name %] [% END %] [% END %] This example shows how you might walk down a directory tree, displaying content as you go. With the recurse flag disabled, as is the default, we need to explicitly call the "scan()" method on each directory, to force it to lookup files and further sub-directories contained within. [% USE dir = Directory(dirpath) %] * [% dir.path %] [% INCLUDE showdir %] [% BLOCK showdir -%] [% FOREACH file = dir.list -%] [% IF file.isdir -%] * [% file.name %] [% file.scan -%] [% INCLUDE showdir dir=file FILTER indent(4) -%] [% ELSE -%] - [% f.name %] [% END -%] [% END -%] [% END %] This example is adapted (with some re-formatting for clarity) from a test in t/directry.t which produces the following output: * test/dir - file1 - file2 * sub_one - bar - foo * sub_two - waz.html - wiz.html - xyzfile The "recurse" flag can be set (disabled by default) to cause the constructor to automatically recurse down into all sub-directories, creating a new "Template::Plugin::Directory" object for each one and filling it with any further content. In this case there is no need to explicitly call the "scan()" method. [% USE dir = Directory(dirpath, recurse=1) %] ... [% IF file.isdir -%] * [% file.name %] [% INCLUDE showdir dir=file FILTER indent(4) -%] [% ELSE -%] ... The directory plugin also provides support for views. A view can be defined as a "VIEW ... END" block and should contain "BLOCK" definitions for files ('"file"') and directories ('"directory"'). [% VIEW myview %] [% BLOCK file %] - [% item.name %] [% END %] [% BLOCK directory %] * [% item.name %] [% item.content(myview) FILTER indent %] [% END %] [% END %] The view "print()" method can then be called, passing the "Directory" object as an argument. [% USE dir = Directory(dirpath, recurse=1) %] [% myview.print(dir) %] When a directory is presented to a view, either as "[% myview.print(dir) %]" or "[% dir.present(view) %]", then the "directory" "BLOCK" within the "myview" "VIEW" is processed. The "item" variable will be set to alias the "Directory" object. [% BLOCK directory %] * [% item.name %] [% item.content(myview) FILTER indent %] [% END %] In this example, the directory name is first printed and the content(view) method is then called to present each item within the directory to the view. Further directories will be mapped to the "directory" block, and files will be mapped to the "file" block. With the recurse option disabled, as it is by default, the "directory" block should explicitly call a "scan()" on each directory. [% VIEW myview %] [% BLOCK file %] - [% item.name %] [% END %] [% BLOCK directory %] * [% item.name %] [% item.scan %] [% item.content(myview) FILTER indent %] [% END %] [% END %] [% USE dir = Directory(dirpath) %] [% myview.print(dir) %] AUTHORS
Michael Stevens wrote the original Directory plugin on which this is based. Andy Wardley split it into separate File and Directory plugins, added some extra code and documentation for "VIEW" support, and made a few other minor tweaks. COPYRIGHT
Copyright (C) 2000-2007 Michael Stevens, Andy Wardley. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template::Plugin, Template::Plugin::File, Template::View perl v5.12.1 2008-11-13 Template::Plugin::Directory(3)
All times are GMT -4. The time now is 07:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy