Posted 20.12.2001 | Updated 23.05.2006 | Contributed by Andy Mallett
Like MS-DOS, there is a nack to moving around the Linux command line and life gets easier once a few rules have been noted. Unlike DOS which shows the full path, Linux only shows the current directory at the command prompt, by default.
The pwd command (print working directory) will show the full path to the current
directory, starting from root ( / ).
Many Unix commands have DOS equivalents and are sometimes interchangeable. The DOS dir (directory listing) can be used in Linux, although the Unix ls (list) command will do a better job by listing directories and files in different colours.
|
|
As with DOS, typing the cd command (change directory) followed by a space and the directory name will change to the required directory, - i.e. cd / changes back to root directory from anywhere in the tree
There is a DOS command called doskey (type it in DOS any time), which once invoked lets a user see recently typed commands simply by pressing the up and down keyboard arrows. Linux does this automatically, which helps cut down on the keyboard presses. Use the arrows, Luke.
Additionally some Unix shells like bash have a special use for the tab key, which can be used to complete
the typing of file and directory names for you. For instance, typing a command such as cd and the first letter of the directory and then pressing tab, will cause the system to bring up a listing of local directories starting with that letter, - i.e. at root type cd b (tab) and the system suggests the directories bin or boot. Adding the second letter bo (tab) will cause the system to complete the rest of the directory name boot. Very handy for long strings of text.
The use of the tab key makes life a bit easier in a command line environment like Unix. This trick can be used to complete both directory and filenames after typing the relevant Unix command. Give it a try, the tab key can set you free..
|
|