View Full Version : making a cd.. comand?
hcker2000
October 14th, 2005, 08:43 AM
I need to know how to make a command (cd..) that you guesed it dose the same thing as cd ..
I tryed as sudo and in the /usr/bin/ directory
nano -w cd..
put cd .. in the file (also tryed cd\ ..)
chmod +x cd..
Dosn't work :(
Leif
October 14th, 2005, 08:47 AM
edit ~/.bashrc, put in :
alias cd..="cd .."
save, start a new terminal and see if it works
hcker2000
October 14th, 2005, 09:21 AM
Thanks that works much better. Saves time I wonder why they don't just set it up that way to begin with.
Pablo_Escobar
October 14th, 2005, 09:26 AM
Because when You cd some directory You type : "cd /home" not "cd/home".
It's the way to unify commands.
GeneralZod
October 14th, 2005, 09:49 AM
Because when You cd some directory You type : "cd /home" not "cd/home".
It's the way to unify commands.
Yep, there's ambiguity without a space - an unusual situation, to be sure, but what if the user had a directory called "cd" in the current directory, and an executable called "home"? Far-fetched, but the bash command-line is designed to be as unambiguous as possible, for obvious reasons! :)
Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.