Thursday, February 13, 2014

2 handy bash tricks

I just came across two handy bash tricks

1 - If you need to run a different command on a file you just executed a command on, without retyping the filename.

ex:
- ls file1234.txt
- more file1234.txt

An easy way is

- ls file1234.txt
- more !^

2 - Switching back and forth between the last two directories.


cd -
check man pushd for multiple directories.

No comments:

Post a Comment

Followers