How to create a command to enter into a dir?

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat How to create a command to enter into a dir?
# 1  
Old 03-29-2013
How to create a command to enter into a dir?

Hi all,

I want to create a command for entering into a specific dir.
for eg
if i want to go to /var/spool/postfix/pid
at any point if i enter a command suppose "sp" in the
command line it should take me to /var/spool/postfix/pid

thanks
# 2  
Old 03-29-2013
Code:
alias sp='cd /var/spool/postfix/pid'

This User Gave Thanks to anbu23 For This Post:
# 3  
Old 03-29-2013
got it .. appreciate your quick response Smilie

---------- Post updated at 04:18 PM ---------- Previous update was at 12:04 PM ----------

Jst an update .. to make that permanent .. i put the command in /etc/bashrc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I create a tar file for only dir and its subdir structures??

How do I create a tar file for only dir and its subdir structures?? (4 Replies)
Discussion started by: vx04
4 Replies

2. Shell Programming and Scripting

Loop logic, enter into respective IF as per enter input file name

have three big data file, however I just need to see the mentioned below one line form the all the file which has SERVER_CONNECTION Value File 1 export SERVER_CONNECTION=//dvlna002:10001/SmartServer File2 export SERVER_CONNECTION=///SmartServer File3 export... (1 Reply)
Discussion started by: Nsharma3006
1 Replies

3. HP-UX

[Solved] Unable to change/create home dir for particular user

Hi all I wanted to change the home dir for a user, but when using smh : SMH->Accounts for Users and Groups->Local Users->Modify User ---------------------------------------------------------------------------------------------------------------------------------------------- * Required... (8 Replies)
Discussion started by: fretagi
8 Replies

4. UNIX for Dummies Questions & Answers

TWO QUESTIONS...How to create your own command in UNIX server,How to enter data in a file by script

I am a quite newbie on UNIX SCRIPTING...Please help me solving this two questions... 1st Question; I want to create one command that will run a script when anyone use that command on that server... I mean, in the prompt if I put my name 'Rony' it will execute a script called 'rony.sh'. How can... (1 Reply)
Discussion started by: Rony-123
1 Replies

5. Shell Programming and Scripting

Create file Dir and Sub Dir same time

Hi Guys , I want create files Dire and Sub Dire. as same time using variable. EX: x1="/hk/Pt/put/NC/R1.txt" x2="/hk/pt/Put/Ot/NC/RN.txt" And i want delete all after done with my script. Thanks (2 Replies)
Discussion started by: pareshkp
2 Replies

6. Shell Programming and Scripting

create dir in main &subdirs,perform action

Hi, I have one dir which has N subdirs.For ex: /home/user/Project_Src /home/user/Project_Src/Dir_A /home/user/Project_Src/Dir_A/subdir/sub_dir2 /home/user/Project_Src/Dir_A/subdir/sub_dir3 /home/user/Project_Src/Dir_B /home/user/Project_Src/Dir_B/Build i want to create a folder with... (2 Replies)
Discussion started by: dragon.1431
2 Replies

7. Solaris

Requesting help to automatically create home dir on login

I know we would not normally do this. However, I would like to have user's home directory created when they log in the first time. I have searched the forums and have not found any help yet. Scenario - environment uses NIS for auth and usually NFS mount HOME. However, I have a pilot environment... (4 Replies)
Discussion started by: 22blaze
4 Replies

8. UNIX for Advanced & Expert Users

Create a file and enter data in columns

Hello!!!!!!!! I have an issue regarding inserting records in a file columnwise.Is it possible using awk/nawk script? Example: File1: 1|AAA|25|2 5|qqe|20|7 4|wer|31|81 I need to create a second file in which data can be inserted in a columnwise manner i.e. File2: AAA|25|1|2... (1 Reply)
Discussion started by: abhijeet1409
1 Replies

9. HP-UX

command su : enter directly

Hi, a simple question : How can I sent user and password to the command su. I need this for a script, but the problem is the command su wait for the password. Thanks. (2 Replies)
Discussion started by: mvaquerm
2 Replies

10. Shell Programming and Scripting

how to create new dir fro a file list

Hi, What will be the best way to do the follwing: i have a file calld dir.list /cav /cav/brif /usr/main /cat i want to run a script that will take each of the item in the file and create a new dir in a location that i'll choose it nee to do mkdir cav mkdir cav cd cav mkdir brif... (8 Replies)
Discussion started by: banjo
8 Replies
Login or Register to Ask a Question