blob: 49476a37a3d22b8f0824058368ad13a048447351 (
plain)
1 Command Line Autocomplete
2 =========================
3 :author: Aaron Ball
4 :email: nullspoon@iohq.net
5
6
7 == {doctitle}
8
9 I was working with a fellow aspiring Linux user today on a project with him
10 (yes, I'm talking about you Eric) and I noticed that when he would 'cd', he
11 would completely type the folder name, even when it was apache-tomcat-6.0.26.
12 If you've been using Linux for any amount of time, this might give you a
13 headache because you know about Bash's autocomplete feature. I mentioned it to
14 him and after seeing what it did, he exclaimed that he had been looking all
15 over for that and was never able to find it.
16
17 Note that this little trick works on windows command line as well as linux/unix
18 command line (most shells support some variant of this - bash, zsh, ksh). While
19 the two categories behave slightly differently, it still provides a
20 functionality that is comparable to that of a breath of fresh air in a sewage
21 treatment plant.
22
23 For those of you who are impatient, **the auto-complete feature of bash is
24 executed with the <tab> key**.
25
26 How is it used? We'll use linux for this example.
27
28 If you type ...
29
30 ----
31 cd /usr/li <tab>
32 ----
33
34 ...the shell will fill in /usr/lib. Now, you will notice that there are two
35 directories in the /usr/ directory that start with lib. If you then proceed to
36 type...
37
38 ----
39 cd /usr/libe <tab>
40 ----
41
42 ...the shell will fill in /usr/libexec.
43
44 Neat, huh?
45
46
47
48 Category:Linux
49 Category:Bash
50
51
52 // vim: set syntax=asciidoc:
|