I try to use the commands cd..
and cd.
in the terminal to move from my current folder to a previous one, and it shows me a message that the command doesn't exist...
What could the problem be? I'm using Ubuntu 18.04 LTS.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI try to use the commands cd..
and cd.
in the terminal to move from my current folder to a previous one, and it shows me a message that the command doesn't exist...
What could the problem be? I'm using Ubuntu 18.04 LTS.
You need to add a space between the commmand (cd
) and the arguments (the path where you want to go).
In your case, you should use cd ..
instead of cd..
Also, please note that the previous folder directory is not the same as the parent directory. I encourage you to check this answer to obtain more information about the directory navigation basics in Linux.
cd -
.
– Emil Jeřábek
Aug 29 '18 at 14:34
Try this to save your sanity:
alias cd..='cd ..'
Now you can type it either with the space or without and it will still work.
Explanation: Windows and MS-DOS allow you to type CD.. to change directory to one level higher than you currently are. Some commands are built in to the command interpreter on those systems. Linux (and probably other *nixes) looks for a program followed by arguments, and the only way to separate the program and arguments is with a space. Hence, Linux is only seeing one command called 'cd..' and it can't find the executable for it. What you mean is 'cd ..' (cd => program, .. => argument).
My solution adds an alias for 'cd..' so that when you type that on a command line the system will instead run 'cd ..' (with space). See the other comments to this answer to see about adding that as a permanent alias.
kk
and öö
as alias for ll
;-) and yoda
as alias for sudo
:-D
– pLumo
Aug 29 '18 at 14:19
cd
is also a builtin command on unix shells — but builtin commands obey the same syntax as external commands they don't get their own rules :)
– hobbs
Aug 29 '18 at 19:41
cd
) and the arguments (the path where you want to go). By the way: welcome to AskUbuntu. – 0x2b3bfa0 Aug 29 '18 at 13:29cd..
is a Windows thing.. – George Udosen Aug 29 '18 at 13:31