Monday 17 November 2014

10 Super Powerful Linux Commands You Should Know!

We always say that the most powerful Linux tools are its Command lines. This is because you can do about everything right from your command line. You can easily explain your computer exactly what you require and it comes back to you with appropriate results. Infact there are some commands that make this tool even more powerful! Here we bring to you a list of 10 such commands that work like energy drinks for you Linux machines!

Linux, open souce, Linux command line, Linux commands, Linux command line tricks, command line tricks, command line tips




1. Runing the last command as Root

sudo !!

Also if you want to open some file to make changes and right when want to save it, you realise that you forgot to open it as root, there is nothing to worry. The command above is your solution.

2. To find your external IP address.

curl ifconfig.me

3. Run your previous command with replacing “foo” with “bar”

^foo^bar

Or alternatively you can use the below command:

!!:gs/foo/bar

Also after running a long command, if you realise that you have made a mistake, this command helps you replace that one word instead of running the whole command again, unlike the previous command which can only replace foo.

4. Auto-empty any file without removing it

> file.txt

5. Execute command without saving it in the history

command

6. Slick way to copy or backup a file before you edit it.

cp filename{,.bak}

7. Traceroute is a nice command but how about a single network diagnostic tool that can combine traceroute with ping? mtr is your command.

mtr efytimes.com

8. To Clear your terminal's screen

ctrl-l

9. List of commands you use most often

history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head

10. Saving the file you edited in vim/vi without the required permissions

:w !sudo tee %

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...