Some Linux tools

Source: Internet
Author: User
Tags ssh access git clone

Because I majored in electronics, so probably last year, I also do not know Linux a bit, I always thought that the operating system is windows, writing programs should be used vs that IDE. So, when I first came into Linux, I was extremely uncomfortable, and I could say it was very repulsive to Linux, and I was quite in favor of an article I had seen: Programmers using Linux are masochism. Especially with the shell, how does this work? Is the operation of the computer should not be mouse click? and write code, VIM is more perverted ah, unexpectedly someone use this kind of thing, simply can't understand. Although Linux now has a graphical interface, but with Windows than this is slag good ...

Later, because of some reasons have to use Linux, slowly, from the beginning of the CD command do not know, and then slowly adapt to the Linux, began to use the command line operation, especially in the case can not use the GUI, slowly realize the power of the shell. Of course, it will take a while to get used to Linux, especially when users who have never been in touch with Linux are turned from Windows. However, after a period of use I think programmers will like Linux. Like the word in the Unix-haters Handbook: "The fundamental difference between Unix and the Macintosh operating system is." Unix is designed to programmers, whereas the MAC is designed to the users. (Windows, on the other hand, were designed to accountants. " Linux is a UNIX-like operating system, Linux is designed for programmers because it is very flexible, you can use it to achieve anything, if you are not comfortable with a tool, you can change it, build one yourself. For programmers with a geek spirit, they are happy to develop some wheels to help them benefit later. At the same time, because these easy-to-use and slightly messy tools exist, so that the learning cost of Linux is more expensive, you can choose more people do not know how to choose.

The so-called 工欲善其事, its prerequisite. Therefore, it is very important to draw on the experience of others to choose some useful tools, the following are some of the tools I feel good, although a lot of my use is not very familiar, and a lot of powerful features I have not used, but still recorded, in order to facilitate their own (because if you change an environment will be re-match again, Also want to flip someone else's blog, very troublesome), so according to my usage habits recorded down. In addition, if others feel useful, you can also look a little bit, and later if you encounter good tools I will be recorded in this blog.

1.htop

Htop is an interactive process viewer in a Linux system, and a text-mode application (in the console or X terminal) requires ncurses.

Htop is more user-friendly than the traditional Linux top. It allows users to interact interactively, support color themes, scroll through the list of processes horizontally or vertically, and support mouse actions.

Compared to top, Htop has the following advantages:

You can scroll through the list of processes horizontally or vertically to see all the processes and the complete command line. Htop can also view details such as CPU usage, in short I think Htop is better than top.
The Htop interface is as follows:

Htop installation is relatively simple, can be installed directly with Apt-get:

sudo apt-get install htop
2.zsh

Ubuntu default shell is bash, but Zsh is a more powerful shell, but because the configuration is too complex, although it is very useful but not many people, until there is an open-source project called Oh-my-zsh, it reduced the difficulty of using zsh down, Next we look at how zsh is installed and configured.
Mac defaults directly to Zsh, but Ubuntu does not have Zsh installed by default and requires our own installation:

sudo apt-get install zsh

Then install Oh-my-zsh:

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zshcp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

To change the default shell:

-s /bin/zsh

Then exit back into the shell and you can use ZSH. Zsh full function is very powerful, switch directories can even without CD directly enter the directory you want to switch, of course, zsh function far more than this, the specific use can refer to the ultimate Shell, which has more detailed zsh function introduction.

3.tmux

Tmux is an excellent terminal reuse software, even if the non-normal drop line, but also to ensure that the current task runs, this is particularly useful for remote SSH access, the network is not a bad situation can still ensure that the work site is not lost! In addition, Tmux fully uses the Keyboard control window to achieve the window switching function. Take a look at the use of a tmux:

Here, I cut the window into three windows, one to open vim, the other to browse the file, run the debugging program. Of course, if you like, you can cut the window into any of them, as long as your screen is big enough. I've been opening a bunch of terminal windows on the graphical interface before I used Tmux, and then waiting for half a day to use it, tmux greatly facilitated our use of the shell.
Tmux Another very good feature is to save the work site, if you use SHH to connect the server work, the network is not so well, and sometimes fall off the line, the work before the fall off may be lost, after the tmux you do not have to worry about, after dropping the line Tmux still run in the background, After reconnecting you just run Tmux attach and the job site is back.
Of course, Tmux there are other features, the same you can personalize their own use of tmux habits, only need to configure ~/.tmux.conf files, specific ways to use see Tmux How to use and personalized configuration

4.vim Plug-in

Write programs under Linux, especially when there is no graphical interface, generally we use vim to write programs, of course, Emacs is also a very good editor, this look at personal habits choose their favorite editor. Vim is a relatively classic editor (a VIM tutorial is highly recommended here: A concise vim walkthrough), but if you do not configure VIM, you may find vim inconvenient and anti-human. Fortunately, there are many great gods for everyone to make good wheels (that is, a variety of plug-ins), the use of these plug-ins, Vim is not a bit worse than the IDE, first on a vim configuration diagram:

This configuration can be found here. The more powerful configuration is spf13-vim.
These configurations are very powerful, plug-ins are many, but some I do not need, what I need most is the following four plugins: Vundle,nerd Tree,youcompleteme,vim Powerline.

Vundle

Vundle is a vim plug-in management tool that can search, install, update, and remove Vim plugins without the need to manually manage vim plugins.
Install Vundle:

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

Add the following configuration to the. VIMRC:

SetNocompatible"be improved, requiredfiletype off"Required"Set the runtime path to include Vundle and Initializeset Rtp+=~/.vim/bundle/vundle.vimcall vundle#begin ()"Alternatively, pass a pathwhereVundle should install plugins"Call Vundle#begin (' ~/some/path/here ')"  LetVundle Manage Vundle, Requiredplugin' Vundlevim/vundle.vim '"The following is examples of different formats supported."Keep Plugin commands between Vundle#begin/end."plugin on GitHub repoplugin ' tpope/vim-fugitive '"Plugin from http://vim-scripts.org/vim/scripts.htmlPlugin' L9 '"Git plugin not hosted on Githubplugin ' Git://git.wincent.com/command-t.git '"Git repos onYourLocalMachine (i.E.When working onyour own plugin) plugin' File:///home/gmarik/path/to/plugin '"The Sparkup vim script is in a subdirectory of this repo called Vim."Pass the path to SetThe Runtimepath properly.Plugin' Rstacruz/sparkup ', {' RTP ':' vim/'}"Install L9 and avoid a naming conflict if you ' ve already installed a"Different version somewhereElse.Plugin' Ascenator/l9 ', {' name ':' newL9 '}"All of your Plugins must is added before the following Linecall Vundle#end ()"Requiredfiletype Plugin Indent on    "Required"  toIgnore plugin indent changes, instead use:"filetype plugin on""Brief Help":P luginlist-Lists configured plugins":P lugininstall-installs plugins; Append '! ' to update or just:P luginupdate ":P luginsearch foo-Searches for Foo; Append`!`  toRefreshLocal Cache":P luginclean-confirms removal of unused plugins; Append '! ' to auto-approve removal"See:h vundle for more details or wiki for FAQ"Put your non-pluginStuff after the line

Of course, the above plugin is not necessary, this is an example of how to use different types of plug-ins How to add, you can choose the plug-in you need to add to the above lines. After you have configured the. vimrc file, open vim, run it, :BundleInstall or run it directly in the Shell vim +BundleInstall +qall , and start installing your various plugins:

You can also refer to vim configuration, plug-ins, and usage tips for specific usage.

NERD Tree

NERD trees is a tree-shaped directory plugin that allows you to browse directories and files in your current directory.

I configured nerd tree in the ~/.VIMRC file, set a key mapping to enable or disable nerd tree nmap <F5> :NERDTreeToggle<cr> so that you can click F5 in vim to open or close the nerd tree.

Youcompleteme

You may have used VS's code complement function memory deep, in fact, vim under the same can be done code completion, Youcompleteme is such a plug-in. Youcompleteme is a fast, fuzzy-matching vim code completion engine.

The installation of the Youcompleteme is a little more cumbersome, and it needs to compile the youcompleteme after the Vundle plugin executes the plug-in installation, executing the following command:

cd ~/.vim/bundle/YouCompleteMe./install.py

Of course, there are different ways to support different languages, and you can refer to GitHub for details.

Vim Powerline

Another plugin is vim Powerline,vim powerline is a display vim status bar plugin that can display information such as VIM mode, operating environment, encoding format, number of rows/columns, etc.

For the time being, I think the tools are all that, and later I feel like other tools will be updated here, and finally thank those great gods who made these wheels and open source to everyone, and if you use these tools, you might as well give them a star on GitHub.

5. References

1. Ultimate Shell
How to use 2.tmux and personalize configuration
3.Vim configuration, plugins, and usage tips
4.spf13/spf13-vim
5.vundlevim/vundle.vim
6.valloric/youcompleteme

Some Linux tools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.