Quantcast
Channel: tips – SitePoint
Viewing all articles
Browse latest Browse all 9

10 Time-saving Terminal Tips for UNIX Beginners

$
0
0

The terminal is the preferred choice of working space for many web developers these days. And why not? With the right set of commands, the terminal can definitely get things done faster. However, beginners make certain time-consuming mistakes. Time is money and in this post, we’ll focus on a few areas that can help you complete your actions quickly and efficiently.

1. Use Tab Completion

This is perhaps the most common mistake I have seen beginners make. Suppose you need to open a file named “my_long_file_name.py” in a text editor. You type the whole name of the file and hit enter — only to realize you misspelled it. So you start typing it again. That’s not how it should work.

Once you have typed 2-3 characters, hit tab and the rest of the name would be competed for you. If you have similar file names (like “my_long_file_name.py” and “my_long_file_name.py.bkp”), the common part would be completed for you and you would be shown both options, as shown below.

DuN5M

The same applies for commands too. Type in part of the command and hit tab to complete the command. If there are similar commands, you would be shown the option just like in case of the files.

There is no downsides of over tabbing, so go ahead and start using it frequently, if you haven’t already.

2. Use !! to prefix to the last command

In a previous article, I mentioned sudo !! runs the previous command with administrator privileges. What I didn’t mention is that all !! does is replace itself with the previous command.

To perform the same task, hit the ‘up’ arrow, followed by the home key (or Fn + <-) to reach the beginning of the command. It really comes down to your personal choice.

In addition, !:n selects the nth argument of the last command (but not the rest of the command), whereas !$ selects the last argument of the last command.

7hFQZ

Continue reading %10 Time-saving Terminal Tips for UNIX Beginners%


Viewing all articles
Browse latest Browse all 9

Latest Images

Trending Articles





Latest Images