When I use "cd" command to move to certain directory in terminal, I press Tab button to autocomplete the directory name, and a "/" sign appends at the end. But, when I use some other command (say "mv"), clicking on Tab button to autocomplete the directory name, autocompletes the directory name, but does not append "/" after it, but a space. So, I have to manually delete the space by pressing Backspace button and type "/". But, in my friend's laptop, it does not occur. Whichever command he uses, he always gets "/" after presing Tab button to autocomplete the directory name. Please tell how to solve this problem. I have freshly installed 12.04 LTS version.  See the screenshot here:
123826
There's something odd about my autocomplete in the gnome terminal.  I used to be able to type cp Downtab to get cp Downloads/, and then type Jettab to end up with cp Downloads/Jet\ Pack\ Instructions.pdf  But now, when I have cp Down typed and hit tab, I get cp Downloads with a space afterwards. And if I backspace that and make it say cp Downloads/Jet and hit tab, I get cp Downloads/Jet Pack Instructions.pdf without the backslashes.  It wasn't like this before. How do I fix this?  EDIT: There's a problem with my /etc/bash_completion file, it seems. Just not sure what.
34462
I accidentally forgot to specify destination before hitting the Return key. Where does mv ./* without specifying destination move the files and directories under current directory to?
22652
I was working in the bash terminal on my system (OSX 10.8.3 / bash version 3.2.48(1)-release (x86_64-apple-darwin12)) and I accidentally typed "cd //" instead of "cd /" to get back to the root directory.    Strange thing was that it took me to "//" which when I listed looked exactly like "/".    So my questions are:  Is there any semantic difference betweens these two paths?  What if anything is the purpose of these two paths?   and/or is it a bug?
23932
I'm on a Mac and the cp and mv commands are killing me due to them copying the contents of a directory if a trailing slash is present. It has bitten me more than once when I use tab completion to specify the directory I want to copy.  I have noticed zsh has a neat feature that removes the trailing slash if it's not needed after a space or enter key is pressed. Is there any way to have bash mimic this behavior?
93227
I was checking the path of cd command in macOS terminal using which cd, I got /usr/bin/cd, so whenever I use this full path to execute cd it doesn't work as expected.  So here are some examples.   Any valid path here root(/) as arg.  /usr/bin/cd / -> doesn't change dir as specified Any invalid path here (kjfd) as arg.  /usr/bin/cd kjfd -> /usr/bin/cd: line 4: cd: kjfd: No such file or directory   So, I really don't understand why cd with complete path address(/usr/bin/cd /) is not working while other commands like bin/echo do work.
32412
When using the terminal in a deep folder structure sometimes the prompt can take up most of the line.  Is there any way in which I can trim the working directory?  I know I can do  PS1="\W &gt;"   to only print the current directory and not the full path, but is there a way to have something like:  /home/smauel/de...ther/folder &gt;
82137
On Windows/DOS terminals a cd.. correctly change the directory.  On Linux terminals the dots from the cd command have to be separated. I'd like to know how/why is this necessary for the parser to work. If no space is added then the command is not understood.   This works well   cd ..   This does not work  cd..   Probably the regExp or whatever is parsing the commands is not including the dot as a possible character immediately after the command.
62880
Using bash on ubuntu (debian jessie/sid) I'm not sure why I can't do tab completion of a wildcard with a builtin command.  for example, suppose my current working directory contains the following subdirectories..  % ls -l drwxr-xr-x 2 userX 4096 2016-08-31 11:46:40 0830a/ drwxr-xr-x 2 userX 4096 2016-08-31 11:46:52 0830b/ drwxr-xr-x 2 userX 4096 2016-08-31 11:47:33 0831a/ drwxr-xr-x 2 userX 4096 2016-08-31 11:47:18 0831b/ drwxr-xr-x 2 userX 4096 2016-08-31 11:50:38 z0830z/   I am able to hit [tab] after typing 'ls -l *31a' and get the completion to occur..  ls -l *31a&lt;tab&gt;   completes to..  ls -l 0831a   however, if I attempt the same with the builtin 'cd' command, it will not complete..  cd *31a&lt;tab&gt;   .. will not complete  Also, using a trailing wildcard fails as well..  cd z*&lt;tab&gt;   .. will not complete  Interestingly, completion without a wildcard character works OK for the builtins. For example, I am able make this completion work OK:  cd z&lt;tab&gt;   is completed to..  cd z0830z/   furthermore, I can use the 'cd *31a' command as-is and have it succeed (so long as it is unique). But I want the expansion to occur so I know for sure what I'm cd-ing into.  My .inputrc contains this..  $if Bash   Space: magic-space   set mark-directories on   set mark-symlinked-directories on   set completion-ignore-case off   set show-all-if-ambiguous on $endif   I don't have a ~/.bash_completion file. I do have /etc/bash_completion, which only does a source of /usr/share/bash-completion/bash_completion. That latter file is a bit long so I won't include it here.  My ultimate goal is to be able to have wildcard completion work for the cd command.
116955
Is there any difference between a directory name such as  mydirectory   and  mydirectory/   I noticed this happens when I execute ls in some directories - some of the directory names have a slash and some don't. This is problematic because if I want to access a file contained in a directory, I may need to add a slash at the end:  vi $mydirectory"/"$myfile   or simply do   vi $mydirectory$myfile
11967
I need to know how the directory name in order to type it out in the terminal. How do I access the names of directories?   Windows Explorer used to have a title bar with the full path. Can someone please help me figure out how to see the full path of a certain file?
67379
I'm on 12.04 Desktop.  When browsing the file system, it's convenient to type Ctrl+L so as to get the file path "Location" to render as a string; I can then modify the file path or even paste something in and get redirected right where I want to go.  But often, after typing Ctrl+L, I find myself wanting to revert back to the normal way Nautilus renders the file path (as a series of buttons/links). What's the magical shortcut to "undo" Ctrl+L and go back to "normal mode"? Thanks in advance!
67431
In terminal, how can I define a key to go to the previous directory which I was in when changing directory with the cd command?  For example, I'm in /opt/soft/bin and I cd into /etc/squid3 and I want to get back to the first directory.
8187
Writing my first script so I'm sure this is a basic question, but can someone please explain to me why I can:  cd ~ cd bin cd ~/bin cd 'bin'   But not  cd '~' cd '~/bin'   I need to cd to a directory path with a space in one of the directory names, so I need the quotes (it's Windows Program Files under wine). I can get around it with two cd commands, but why can't I put ~ in quotes?  If I type cd '~' (or cd "~") I get:  bash: cd: ~: No such file or directory
72260
I can't figure out how to write the path of a folder that includes spaces in its name (in Terminal).  I tried:  cd /path/path/path/"A Folder"/file  cd /path/path/path/'A Folder/file  cd /path/path/path/A_Folder/file   but they all return the error through the terminal:  [command]: cannot access '/path/path/path/A Folder/file' No such a file or directory    I can still access it through steps like so:  cd /home cd user cd Desktop cd "Bash Programming" bash Example
118654
In a bash sub shell I get the following error when running cd  sudo: cd: command not found   This is expected because I don't have a path. Usually to work around this I just provide the full path like so:  (/usr/local/bin/foo)  Much to my surprise, cd does not appear to be in any of the normal places.  which cd whereis cd ls /bin | grep cd   By comparison, ls is right where I would expect.   which ls /bin/ls   Where is the cd command located? And why is different from all the other commands?   Update  Another interesting tidbit, cd does not show up in hash  hash 0   /bin/ls 2   /usr/bin/find 2   /sbin/ip 1   /usr/bin/updatedb 1   /usr/bin/apt-get
20269
This is not about new macros like \newcommand, \def and others. This is not about autocompletion like using .cwl (in TexStudio) This is also not about using shortcuts for predefined commands that are listed in the shortcuts sections.   It is more closely related to the 3. Though. I want to define shortcuts for commands that are not listed there.  e.g. When I type Ctrl + Shift + B, I want   \begin{bmatrix} \end{bmatrix}   to be inserted just like Ctrl+ Enter inserts \\.
31667
Currently ZSH displays a menu when I first hit tab and the completion is ambiguous. So, if I have 'cd ' in the command prompt and I hit tab, it will show the different available completions. If I hit tab again, it will select the first available completion.   I would like to merge these two steps into a single press of the tab key. So, if I'm at 'cd ' and I tab, I would like ZSH to insert the first available match (when ambiguous) and display the menu, which I can then tab through if the first match wasn't the directory I had in mind.  The ZSH setup tool put this in my .zshrc, in case any of this is affecting the behavior of my shell:   zstyle ':completion:*' completer _expand _complete _ignored zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' zstyle ':completion:*' menu select=5 zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle :compinstall filename '/home/robb/.zshrc'