Introduction to Bio-Linux
Introduction to Bio-Linux
Introduction to Bio-Linux
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Command his<strong>to</strong>ry and filename completion<br />
(aka. how <strong>to</strong> cut down on typing!)<br />
Using your his<strong>to</strong>ry<br />
A his<strong>to</strong>ry of the commands you have used is s<strong>to</strong>red as you work. You can access this list and use it <strong>to</strong> see previous<br />
commands, and <strong>to</strong> re-run previous commands.<br />
If you use the up arrow key when you are at the prompt in your terminal, you can see previous commands you<br />
have run. This is particularly useful if you have mistyped something and want <strong>to</strong> edit the command without<br />
writing the whole command out again.<br />
You can view past commands using the command his<strong>to</strong>ry.<br />
To re-run a command listed by the his<strong>to</strong>ry command, you can just type the command number, preceded by an<br />
exclamation mark. E.g.<br />
!268<br />
By default, if you type the command his<strong>to</strong>ry, you will see the last 15 commands. To see more, just put the<br />
number of previous commands you wish <strong>to</strong> see after a hyphen. For example, <strong>to</strong> see the last 30 commands, type:<br />
his<strong>to</strong>ry -30<br />
Using filename completion<br />
If you type in a command with a filename, and instead of completing the filename, you press the tab key part way<br />
through, the system will try <strong>to</strong> complete the filename for you. If the part of the filename you have written is<br />
unambiguous, i.e. there is only one filename that would fit that pattern, the rest of the filename will be filled in for<br />
you. If the pattern is ambiguous, all the filenames that match it will be presented <strong>to</strong> you. You can then choose <strong>to</strong><br />
type out the full name of the file, continue typing until the pattern is not ambiguous and press tab again, or,<br />
instead, if you press tab twice, you will see that the system will cycle through all the filenames that fit your<br />
pattern – you can just keep hitting tab until you get <strong>to</strong> the correct filename.<br />
Exercise<br />
Type<br />
ls hsy<br />
and hit the tab key.<br />
Type<br />
ls test<br />
and hit the tab key. Hit the tab key again. Cycle through the filename options given <strong>to</strong> you.<br />
Type<br />
his<strong>to</strong>ry<br />
Run one of your previous commands using ! followed by the number of the command.<br />
10