Ubuntu (14.04LTS) learning notes, ubuntu14.04lts

Source: Internet
Author: User

Ubuntu (14.04LTS) learning notes, ubuntu14.04lts

This blog post is a notebook for me to learn some knowledge based on Ubuntu, so that I can review it later. Here we will record it in a unified way. Of course, new things will be updated one after another !!! I would also like to ask the bloggers not to smile. Thank you ~ \ (Too many rows )/~ La la !!!!

1. simple configuration of Ubuntu:

For personal reasons, I do not like to put some fancy things on the desktop, and I have always admired the pursuit of simplicity. Therefore, the configuration of my Ubuntu system is no exception. First, upload a spy photo of the desktop:

Sudo add-apt-repository ppa: numix/ppasudo apt-get updatesudo apt-get install numix-icon-theme-circle1.2 install common software:

Unity Tweak Tool, new software package, and sogou input method can all be downloaded from the Ubuntu Software Center and the sogou Input Method official website. I will not go into details about other software here, because I have not installed it, I have little need.

Conky installation and configuration: If you want your desktop to display some information in real time, Conky may help you. Convenient, beautiful, and convenient.

// Install: sudo apt-get install conky // configuration: // after installation, Conky will not be created for you by default. conkyrc file, so we need to create a corresponding file in the current user directory (My is/home/hippiezhou. Then add our configuration code.
// My configuration code is as follows: use_spacer rightuse_xft yesfont Microsoft YaHei: size = 8 xftfont Microsoft YaHei: size = 8 # xftfont WenQuanYi Zen Hei: pixelsize = 12override_utf8_locale yesupdate_interval 1.0own _ window yesown_window_type normalown_window_transparent yesown_window_hints undecorated, below, sticky, skip_taskbar, when yesminimum_size 206 then passed yesdraw_outline When deleting nodefault_color when 000000 alignment when 10gap_y when 2 uppercase no # set to yes if you want all text to be in uppercaseTEXT $ {font Microsoft YaHei: style = Bold: pixelsize = 30 }$ {alignc }$ {time % H: % M: % S }$ {font Microsoft YaHei: pixelsize = 18 }$ {alignc }$ {time % B % d % a }$ {font Microsoft YaHei: pixelsize = 12 }$ {color # ffd700 }$ {hr 1} $ color $ {color #98c2c7} Host Name: $ {color # db7093} $ alignr $ nodename $ {color #98c2c7} kernel: $ {color # db7093} $ alignr $ kernel $ {color #98c2c7} started: $ {color # db7093} $ alignr $ uptime $ {color #98c2c7} IP Address: $ {color # db7093 }$ {alignr }$ {addr wlp1s0 }$ {color #98c2c7} CPU usage: $ {color # db7093} $ alignr $ cpu % $ {color #78af78} $ cpubar $ {color # ddaa00 }$ {top name 1} $ alignr $ {top cpu 1} $ {color lightgrey }$ {top name 2 }$ alignr $ {top cpu 2 }$ {color lightgrey }$ {top name 3 }$ alignr $ {top cpu 3 }$ {color #98c2c7} physical memory: $ {color #4169e1} $ alignr $ {color} $ mem $ {color #98c2c7}/$ {color} $ memmax $ {color #4169e1 }$ {color # db7093} $ memperc % $ {color #78af78 }$ {membar }$ {color #98c2c7} root partition: $ {color }$ {alignr }$ {fs_free/}/$ {fs_size/}$ {color #78af78 }$ {fs_bar 4/}$ {color #98c2c7} Home partition: $ {color }$ {alignr }$ {fs_free/home}/$ {fs_size/home }$ {color #78af78 }$ {fs_bar 4/home }$ {color #98c2c7} download speed: $ {color }$ {downspeed wlp1s0} k/s $ {color #98c2c7} upload speed: $ {color }$ {upspeed wlp1s0} k/s $ {color # ffd700 }$ {hr 1} $ color

// To ensure that Conky can be started every time the system is started, we need to add a system startup Item for Conky.
// Search for "Start application" in your Dash and add our Conky as the startup Item.
Name: conky
Command:/usr/bin/conky-p 10
Note: Load the conky

// Note: If you want to manually start conky, you only need to press Ctrl + Alt + T and enter the command conky.
1.3 disable guest mode:
Vim/usr/share/lightdm. conf. d/50-unity-greeter.conf

// Add a code in the last line:
Allow-guest = false

// Then run ESC->: wq to save it (sudo may be required to escalate the permission)
1.4 other related configurations:

Missing language Pack: language-selector-gnome

Flash Installation: sudo apt-get install flashplugin-installer (to be honest, I have installed this installation for a long time, which is extremely slow !)

 

2. Ubuntu command:
Sudo apt-get autoclean // clear the old software Cache
Sudo apt-get clean // clear all software caches
Sudo apt-get autoremove // Delete isolated software that is no longer in use by the System
Uname-a // view the kernel
Sudo lshw // displays the current hardware information
Pstree // view the current process tree

// Multi-thread download
Sudo apt-get install axel
Axel-N5 http://xxx.xxx.xxx.xxx/xxx.zip
Or
Lftp-c "pget-n 5 http://xxx.xxx.xxx.xxx/xxx.zip"

// How to switch to the root account
Sudo-s
Sudo-I
Sudo su

Cat file name // view the file content on one screen
Cat/etc/vsftpd. conf | grep-v ^ # // The line starting with # is not displayed.
More file name // View File Content by PAGE
Less file name // controllable paging View File Content
Nl file name or cat-n file name // display the file content with a line number
Cut-c 5-a. py // remove the row number from the file
Cat file.txt | sort-u // Delete duplicate rows in the file
Touch filename // create an empty file
Rm-fr folder // recursively Delete nested Directories
File filename // view the file type
Stat filename // view the file time
Diff file1 file2 // view the differences between the two files

Tar-zxvf xxx.tar.gz // extract xxx.tar.gz
Tar-jxvf xxx.tar.bz2 // extract xxx.tar.bz2
Tar-zcvf xxx.tar.gz aaa bbb // compress aaa bbb directory to xxx.tar.gz
Tar-jcvf xxx.tar.bz2 aaa bbb // compress aaa bbb directory to xxx.tar.bz2

Command Shutdown
Sudo halt
Sudo shutdown-h now // shutdown now
Timed Shutdown
Sudo shutdown-h // shutdown automatically at pm
Sudo shutdown-h + 60 // automatically shut down after 60 minutes
Command to restart the computer
Sudo reboot
Sudo shutdown-r now

 

3. Git:

I don't want to introduce this part in detail. I think it can meet my basic needs (clone, pull, push, merge, for some operations on the heights, please refer to other Daniel in the garden. Here, I will only list several frequently used commands to help you learn more.

 

1. Create a code library # create a Git code library in the current directory $ git init # create a directory, initialize it as a Git code library $ git init [project-name] # download a project and its entire code history $ git clone [project-path] 2. Configure the Git setting file. gitconfig, which can be in the user's home directory (global configuration) or under the project directory (project configuration ). # Display the current Git configuration $ git config -- list # edit the Git configuration file $ git config-e [-- global] # Set the user information when code is submitted $ git config [-- global] user. name "[name]" $ git config [-- global] user. email "[email address]" 3. add/delete files # add a specified file to the temporary storage zone $ git add [file1] [file2]... # add a specified directory to the temporary storage area, including the subdirectory $ git add [dir] # add all files in the current directory to the temporary storage area $ git add. # Delete the workspace file and put it in the temporary storage zone $ git rm [file1] [file2]... # Stop tracing a specified file, but the file will be retained in the workspace $ git rm -- cached [file] # rename the file, change the name to the temporary storage zone $ git mv [file-original] [file-renamed] 4. Code submission # submit the temporary storage zone to the warehouse region $ git commit-m [message] # submit the specified files in the temporary storage area are stored in the warehouse $ git commit [file1] [file2]... -m [message] # submit the changes in the workspace since the previous commit, go directly to the repository $ git commit-a # display all diff information when submitting [Ctrl + X and then Y exit] $ git commit-v # use a new commit, replace the previous commit # If the Code does not change, it is used to rewrite the commit information of the previous commit. $ git commit -- amend-m [message] # redo the previous commit, and include new changes to the specified file $ git commit -- amend... 5. branch # list all local branches $ git branch # list all remote branches $ git branch-r # list all local branches and remote branches $ git branch-a # create a new branch, but it still stays in the current branch $ git branch [branch-name] # create a new branch and switch to this branch $ git checkout-B [branch] # create a new branch, point to the specified commit $ git branch [branch] [commit] # create a new branch, establish a tracing relationship with the specified remote branch $ git branch -- track [branch] [remote-branch] # Switch to the specified branch, and update the workspace $ git checkout [branch-name] # To establish a tracing relationship, between an existing branch and a specified remote branch $ git branch -- set-upstream [branch] [remote-branch] # merge the specified branch to the current branch $ git merge [branch] # select commit, merge to current branch $ git cherry-pick [commit] # delete branch $ git branch-d [branch-name] # delete remote branch $ git push origin -- delete $ git branch-dr 6. tag # list all tags $ git tags # create a tag at the current commit $ git tag [tag] # create a tag at the specified commit $ git tag [tag] [commit] # view tag Information $ git show [tag] # submit the specified tag $ git push [remote] [tag] # submit all tags $ git push [remote] -- tags # create a new branch, point to a tag $ git checkout-B [branch] [tag] VII. View information # display changed files $ git status # display version history of the current branch $ git log # display commit history, and the file $ git log -- stat # That changes each time the commit is used to display the version history of a file, including renaming a file $ git log -- follow [file] $ git whatchanged [file] # display each diff related to a specified file $ git log-p [file] # display what the specified file is when did a person change $ git blame [file] # display the differences between the temporary storage zone and the workspace $ git diff # display the differences between the temporary storage zone and the previous commit $ git diff -- cached [] # display the difference between the workspace and the latest commit of the current branch $ git diff HEAD # display the difference between the two commits $ git diff [first-branch]... [second-branch] # display the metadata and content changes of a certain commit $ git show [commit] # display the file changed by a certain commit $ git show -- name-only [commit] # When a submission is displayed, the content of a file $ git show [commit]: [filename] # display the latest commits of the current branch $ git reflog 8. remote synchronization # download all changes to the remote repository $ git fetch [remote] # display all remote repositories $ git remote -v # display the information of a remote repository $ git remote show [remote] # Add a new remote repository, name $ git remote add [shortname] [url] # retrieve the changes in the remote repository, merge with the local branch $ git pull [remote] [branch] # upload the local specified branch to the remote repository $ git push [remote] [branch] # force push the current branch to the remote repository, even if there is a conflict $ git push [remote] -- force # push all branches to the remote warehouse $ git push [remote] -- all 9. Undo # restore the specified file in the temporary storage area to the work zone $ git checkout [file] # restore a specified file of a commit to the work zone $ git checkout [commit] [file] # restore all files of the previous commit to the work zone $ git checkout. # reset the specified file in the temporary storage area, which is consistent with the previous commit, but the workspace remains unchanged $ git reset [file] # reset the temporary storage area and workspace, consistent with the previous commit $ git reset -- hard # reset the pointer of the current branch to specify the commit and reset the temporary store, but the workspace remains unchanged $ git reset [commit] # reset the HEAD of the current branch to specify the commit, and reset the temporary storage and workspace at the same time, consistent with the specified commit $ git reset -- hard [commit] # reset the current HEAD to the specified commit, but keep the temporary storage area and workspace unchanged $ git reset -- keep [commit] # create a new commit, all changes used to cancel a specified commit # the latter will be offset by the former, and apply it to the current branch $ git revert [commit] 10. Others # generate a compressed package for release $ git archive

 

4. Vim:

In fact, Ubuntu has a built-in learning tutorial for Vim. You only need to enter vimtutor in the command line. There is a very detailed tutorial on it, as long as you are willing to be patient. I don't plan to record this part in detail. It's perfect to practice frequently. When I forget this part, I can read the help document and remember it.

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.