using dots to change directories

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers using dots to change directories
# 1  
Old 04-12-2009
using dots to change directories

how would i go down a directory using the ../..
# 2  
Old 04-12-2009
You can only go up levels in a directory structure using '.' and '..'.

The reason is:
'.' == current working directory
'..' == directory above the current working directory
# 3  
Old 04-12-2009
Thanks. Is there any command I could use just to go down a directory?
# 4  
Old 04-12-2009
Only if you know that directory's name. What is it you are trying to do?
# 5  
Old 04-12-2009
I have 2 main directories i work with. I was just wondering if there was a shortcut to go down a directory.
# 6  
Old 04-12-2009
Not by using the 'dots', but you can alias something in your .$SHELLrc file.

Assuming csh: ($HOME/.cshrc)
alias dir1 cd $HOME/path/to/my/dir1
alias dir2 cd $HOME/path/to/my/dir2

Assuming bash: ($HOME/.bashrc)
alias dir1='cd $HOME/path/to/my/dir1'
alias dir2='cd $HOME/path/to/my/dir2'

Last edited by glen.barber; 04-12-2009 at 12:07 PM.. Reason: Forgot to include what the .$SHELLrc files were.
# 7  
Old 04-12-2009
say your two dir paths are
/home/user/dir1 and /home/user/dir2

#cd ../ (this will take you to /home/user
#cd ../dir1 ( to go to dir1 )
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to change Permissions on files and directories

Hey, It's me again. Have a problem, that's not really a problem. I have the below script, that goes to the directory I want it to go to. lists out the directories available, lets you choose the directory you want, then it changes the permissions on said directory. using chmod -R and chown -R. ... (2 Replies)
Discussion started by: gkelly1117
2 Replies

2. Shell Programming and Scripting

How to change directories?

Hi, I am changing my directory structure /opt/multifamily/restatement/weblogic to /users/saanvi/weblogic Am using sed command to changing the directoried names Please hepme out on this. there is any script to change the directories. Thanks in Advance, (9 Replies)
Discussion started by: saanvi
9 Replies

3. Shell Programming and Scripting

underscore to dots

Hi, I have been trying to change underscores to dots. For example: 1122_91 1022_233 . 2237_23 9382_2339 2998_234 345_257 . . Desired output: 1122.91 1022.233 . 2237.23 9382.2339 2998.234 345.257 . . Any idea? Thanks (4 Replies)
Discussion started by: iconig
4 Replies

4. UNIX for Dummies Questions & Answers

Change chmod on files in diff directories

I am looking for a small script to crawl through several directories and change a couple of files in each directory to read write status. Anyone have any ideas ? (5 Replies)
Discussion started by: zapper222
5 Replies

5. UNIX for Dummies Questions & Answers

How to get directories colored when doing change directory and tab

I am trying to navigate between directories using cd. However, the only way to distinguish directories now is by seeing the "/' after the directory names, which is quite inefficient. How can I make the directories look in color when typing cd and then using the tab key to list the files and... (1 Reply)
Discussion started by: genehunter
1 Replies

6. UNIX for Dummies Questions & Answers

how to change permissions only to files, not directories....?

Hi, I am really new to unix, any help is much appreciated. I need to change permissions of all files under several subdirectories to 700 but keep directories readable (755). Why ? Because I need a FTP user to only list his files and can't read them. But to browse to subfolder, the directories... (3 Replies)
Discussion started by: narrok
3 Replies

7. UNIX for Dummies Questions & Answers

Batch Renaming: Change files' extensions in many sub-directories

Hi all - I'm trying to rename a large number of files all at once and need some help figuring out the command line syntax to do it. I've already done quite a bit of research with the rename and mv commands, but so far haven't found a solution that seems to work for me. So: The files exist... (10 Replies)
Discussion started by: dave920
10 Replies

8. UNIX for Dummies Questions & Answers

dots and slashes

when I execute a command in like "," I can run it two ways: ./ or . What is the difference? (1 Reply)
Discussion started by: DarkLord
1 Replies

9. Shell Programming and Scripting

Change permission for directories and files

Is there a way to change subdirectories permission plus the files in the subdirectories in a directory i specified without using the find command? (1 Reply)
Discussion started by: mingfei2006
1 Replies

10. Shell Programming and Scripting

how to change working directories in perl?

i am new to perl. i am writing a perl script. i want to know how to change the working directories? for ex. i have a perl script in c:\proj\ . i want to run this script in this directory but i need my script to change its working directory to D:\xyz\ dynamically in the script. your help is... (1 Reply)
Discussion started by: megastar
1 Replies
Login or Register to Ask a Question

Featured Tech Videos