Ubuntu Advanced Learning, Instruction quick query, Bug Quick query (ctrl+f)

Source: Internet
Author: User
Tags bz2 using git git clone

There is some notes while I am learning Ubuntu Operate system!

(Ask Ubuntu)

the Hard link:ln command has different parm. Hard link means, the both files are connect together for backup the original files. If you edit any of the files, it'll be sync immedietely. If you delete the original file. It'll make all files used. If you delete the copy file, it'll keep the context of the original file.  This command can is not a link the directory but a single file. ln A.txt B.txt

2-- Symbolic link:this is different from the hard link. This command can link the directory.  This one's more usefull than hard link. Ln-s A.txt B.txt

3-- Cat:cat is a command which can read the. txt. py. c etc without opening the origin files. Used like This:cat filename.suffix zcat is another command which can read the zip files:zcat filename.zip.

4-- du-sb;df-i: Read the Memory and disk used and the information of the device.

5-- Ln:the Explaination has already said in the 1 and the point 2.

6-- FDISK:FDISK/DEV/SDA1 Check the information of this device. The Memory,sector,node and so on.

7-- Df:df/command is for checking all device.df-i more information on all the device.

8-- While there was a question about That:sudo apt-get update. Then there is the errors say: "Could not get Lock/var/lib/dpkg/lock". and "Unable to lock administration directory (/VAR/LIB/DPKG), is anther process using it?".

That's the error ' s information tell us, we need to find out, that whether there are anther process is using the dpkg. So we need to type anther command into the Terminal like that: sudo lsof/var/lib/dpkg/lock. Then it return some information like that:

COMMAND PID USER FD TYPE DEVICE size/off NODE NAME

Unattend 9241 Root 5uW REG 8,1 0 699848/var/lib/dpkg/lock

So, We need to kill the process like This:sudo kill-9 9214. (The Fromat:sudo kill-9 <PID>).

After these steps, I can run the system normally. congratulations!

9-- When I moving the Ubuntu Terminal. It receive a command (Ctrl + C) to shutdown the process running in the Terminal. So need to solve this problem like This:shutdown the processing running in your Original system (our Ubuntu are install in The Vmware as a vitrual machine), the named of the process is Youdao Dictionary!

10-- error:unable to find the Remote helper for Https:when I is upload the C files into the remote repository, it show like this error. After finding the answer, It said that the path Named/usr/lib/git-core are not in the System ' s path. So, we need to does is to set the path to include the Git-core path so, we can use the command of git: path= $PATH:/usr/lib/git-core .

11-- When I try- to-Change my authority -to-be- root, It turn out-to-be-authourity fail Ure. So I am going to find the reason. At last it told me that I had not set the root ' password before. We is asked to set a new password for root. We set the password for root used this command:sudo passwd root. After running this command, it asks your to input the password of user now time and then you need to enter the password for RO OT.

12-- When I am using git to manage my code.

There is some stepsfor your to does this (this for you toupdate your code to the github.com!) .

STEP1: Go to the the the file directory which your want to manage the code with the Command ' CD '. After Yo u get into the directory, you need to use the first git command: git init -→this command make the Direc Tory to is a local repository. The later steps is based on this directory.

STEP2: You need to know the status of the directory, using the-git command to get the status: git status. After you using the This command. There show the status of the directory. Then you need to add these new files into the A commit like this: git add filename.

STEP3: When you finished to add the new files into the commit. Now you can commit those files into the local repository. The command like this: get commit-m filename. After this step, you can check the status of the directory like this:git status to insure that there is no files Is new needed to be update.

   Step4: there is Different positions. If you had not connect this local repository to the remote repository located in the service  machine of the git.com . You need to does like this: git remote Add Origin https://github.com/user Name/repository ' s name,gitnotice: we must insure that there has already make a Repository in your GitHub account of github.com. If you had already link your file s to the local repository with the repository in github.com, you just skip this step an D read the next step.

STEP5: After all those operations, the last step of the need to does is:git push-u Origin master .

There is some stepsfor you does this (the the files from thegithub.com).

Step1: you don ' t need to add a new directory in your local computer. You just need to type this in your Terminal: git clone https://github.com/githubusername/local-repository-name . Git

13-- mkfs:the Long Form is:make your file system

14-- badblocks: This command was for you to check whither there was some break sectors in the memory device. It takes more time.

15-- Mount: Mount Commad is important. If you want to operate some devices, it firstly should is mount on. mount-l command means to show all the devices has been mount on. MOUNT/DEV/SDA1 means to mount in the device you want to mount, once mount on, you can use it.before you eject the devices , you should firstly umount the divice like this:umount/dev/sda1. Then you can eject the device. For example (want to operate your flash device):

STEP1: df-i Show all the device been connect to the operation system.

STEP2: Mkdir/media/flash to make a directory to operate the Flash device with this file.

STEP3: Mount/dev/devicename/media/flash to mount the device on the system ' s file.

STEP4: Do-what-want to does on the Flash directory in order to operate the flash device.

16-- Umount: UMOUNT/DEV/SDB1

17-- RM-RF: rm-rf file ' directory . This command can directly delete the whole file directory.

18-- Cp-r: cp-r/original directory/destination directory Copy the whole directory.

19-- DUMPE2FS:

20-- E2label: E2LABLE/DEV/SAB1 MM1994UESTC Change the device name.

21-- hdparm: hdparm/dev/sda1 To show the parameters of device connect to the operate Sys.

22-- Some file ' s suffix inform us the compress type of the file:

*. Z Compressed by compress App

*.gz compressed by gzip App

*.bz2 compressed by bzip2 APP

*.tar been compressed, Open with tar App

*.tar.gz packed by tar app, also been compressed by gzip app

*.tar.bz2 Packed by Tar app, also been compressed by bzip2 app

The Compress Command:

Gzip:

BZIP2:

Gunzip:

tar-jcv-ffilename.tar.bz2 filename

tar-jxv-ffilename.tar.bz2-c filename

tar-zcv-ffilename.tar.gz filename

tar-zxv-ffilename.tar.gz-c filename

The package Command:

Tar: tar-c-ffiledirectoryname.tar original filename

23-- MV: Acommad that can also change the filename. Mv A.txt B.txt

This command also can is used as moving the file into another place.

24-- alias: To Rename the command with another name. EG: alias lm= ' Ls-al ' means. Use the LM name to respect the command Ls-al.

25-- declare-i number= $RANDOM *10/32768 ; Echo $number

26-- History :

27-- vim-r. FILENAME.SWP This command can help you to recovery the file, which has not been saved before which suddenly is killed without saved.

28-- To Install the MySQL on your Ubuntu operation System.

STEP1: sudo apt-get install mysql-server

STEP2: apt-get Install my-client

STEP3: sudo apt-get install Libmysqlclient-dev

After those steps, let us check whether the Mysql-server been installed on our Ubuntu ' system

Command:sudo netstat-tap | grep mysql

If Ubuntu ' s terminal shows that your MySQL ' socket was in listening means so the Mysql-server has been installed SUCCESSFU Lly.

29-- How to remove some App, that we don ' t want to use!

STEP1: sudo apt-get remove mysql-server mysql-client mysql-common

STEP2: sudo apt-get autoremove

STEP3: sudo apt-get autoclean

If you were trying to reinstall the MySQL server, and there was some problems,please redo the three steps above and then EXE Cute the follow command as this:

STEP4: sudo apt-get Remove--purge mysql-\*

STEP5: sudo apt-get install--reinstall Mysql-common (the most important command!)

STEP6: sudo apt-get install mysql-server mysql-client

30-- How to stop/start the mysql-server under Ubuntu?

sudo service MySQL start (notice:in order to prevent the system has already open the service for you and continue try this start command , sudo service mysql restartisbetter! Also,you can use this command to find out while the MySQL service is running:service MySQL status) /c2>

sudo service MySQL stop

sudo apt-get install Ksnapshot

Ubuntu Advanced Learning, Instruction quick query, Bug Quick query (ctrl+f)

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.