mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: July 31 2005,18:57 |
|
If you have created an alias of a comand with the same name as the command (example: alias ls='ls -al'), you can bypass the alias with a prefixed backslash (example: \ls), which runs the command in its default state.
------------------------
Type a "cd newdirectory; command" command in parentheses to bounce you back to your previous PWD after the command has run:
Code Sample | $ cd $ pwd /home/dsl $ (cd downloads/Fluxbox/styles; mkdir newstyles) $ pwd /home/dsl | This isn't particularly efficient in many situations, but it works.
------------------------
Brace expansion can save a lot of typing (and bytes in a script). This means using curly braces to list several unique parts of an otherwise identical command so you don't need to do a lot of retyping.
A couple of examples. First line is the standard command, and the second is the same using brace expansion:
Code Sample | cp filename.one filename.two cp filename.{one,two} |
Code Sample | echo "foo foobar" echo foo{,bar} |
------------------------
reverse-i-search allows you to use auto-completion to cue up past commands. If you have a command you used way back you don't want to bother using the up key to retrieve it. Instead press Ctrl+r and then type a couple of characters. Bash will search through its history and present you with a command including that string.
------------------------
The CDPATH variable can be utilized much like PATH and LD_LIBRARY_PATH. Set up a CDPATH variable something like this: export CDPATH=/usr/X11R6/lib:/path/to/something/else Then do "cd fonts" and you should be taken to /usr/X11R6/lib/fonts
------------------------
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|