Ubuntu进阶学习,指令迅速查询,Bug迅速查询(Ctrl+F)

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

(Ask Ubuntu)

1-- Hard link : ln command have different parm. Hard link means that the two files is connect together for backup the original files.If you edit any of the two files , it will be sync immedietely. If you delete the original file. It will make all files used. If you delete the copy file , it will keep the context of the original file. This command can not link the directory but 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 is 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 have already said in the point 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 about all the device.

8-- while there is a question about that : sudo apt-get update . Then there is two 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 two error’s information tell us that we need to find out that whether there is 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 is 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 was 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 is not in the System’s PATH. So what we need to do is to set the path to include the git-core path so that we can use the command of git: PATH=$PATH:/usr/lib/git-core.

11-- When I try to change my authority to be a root, It turn out to be that Authourity failure. So I am going to find the reason. At last it told me That I have not set the root’password before.We are 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 you to input the password of user now time, then you need to enter the password for root.

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

There is some steps for you to do this(This for you to update your code to the github.com!).

    Step1 : Go to the the file directory which you want to manage the code use the command ‘cd’. After yo u get into the directory, you need to use the first git command: git init  -→this command make the directory to be a local repository. The later steps is based on this directory.

Step2 : You need to know the status of the directory, using this git command to get the status: git status. After you using this command. There show the status of the directory. Then you need to add these  new    files into the 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 two different positions. If you have not connect this local repository to the remote repository located in the service  machine of the git.com. You need to do like this : git remote add origin https://github.com/user name/repository’s name,git . After this o peration, the local repository will link with the remote repository located in the service of github,com. Notice: We must insure that there have already make a repository in your github account of github.com. If you have already link your file s to the local repository with the repository in github.com, You just skip this step and read the next step.

 Step5 :After all those operations, The last step you need to do is :git push -u origin master .

There is some steps for you do this(This is for you to clone the files from the github.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 is for you to check whither there are 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 be mount on. Mount -l command means to show all the devices have been mount on. Mount /dev/sda1 means to mount on 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(You 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 you want to do 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 directoryCopy the whole directory.

19-- dumpe2fs :

20-- e2label : e2lable /dev/sab1 MM1994UESTCChange the device name.

21-- hdparm : hdparm /dev/sda1To 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  Have not 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 be used as moving the file into another place.

24-- alias : To rename the command with another name. EG: alias lm=’ls -al’ means that to 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.swpThis command can help you to recovery the file that have not been saved before which suddenly be 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 is in listening means that the mysql-server has been installed successfully.

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 are trying to reinstall the mysql server ,and there is some problems,please redo the three steps above and then execute 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 have already open the service for you while you continue try this start command , sudo service mysql restartis better!Also,you can use this command to find out while the mysql service is running:service mysql status)

sudo service mysql stop

sudo apt-get install ksnapshot

时间: 2024-10-20 11:40:15

Ubuntu进阶学习,指令迅速查询,Bug迅速查询(Ctrl+F)的相关文章

42步进阶学习—让你成为优秀的Java大数据科学家!

作者 灯塔大数据 本文转自公众号灯塔大数据(DTbigdata),转载需授权 如果你对各种数据类的科学课题感兴趣,你就来对地方了.本文将给大家介绍让你成为优秀数据科学家的42个步骤.深入掌握数据准备,机器学习,SQL数据科学等. 本文将这42步骤分为六个部分, 前三个部分主要讲述从数据准备到初步完成机器学习的学习过程,其中包括对理论知识的掌握和Python库的实现. 第四部分主要是从如何理解的角度讲解深入学习的方法.最后两部分则是关于SQL数据科学和NoSQL数据库. 接下来让我们走进这42步进

MyBatis学习总结(五)——实现关联表查询(转载)

孤傲苍狼 只为成功找方法,不为失败找借口! MyBatis学习总结(五)--实现关联表查询 一.一对一关联 1.1.提出需求 根据班级id查询班级信息(带老师的信息) 1.2.创建表和数据 创建一张教师表和班级表,这里我们假设一个老师只负责教一个班,那么老师和班级之间的关系就是一种一对一的关系. 1 CREATE TABLE teacher( 2 t_id INT PRIMARY KEY AUTO_INCREMENT, 3 t_name VARCHAR(20) 4 ); 5 CREATE TAB

3. 蛤蟆的数据结构进阶三静态查询之折半查询

3. 蛤蟆的数据结构进阶三静态查询之折半查询 本篇名言:"但是话不行,要紧的是做. --鲁迅" 继续来看静态查询的折半查询. 欢迎转载,转载请标明出处:http://blog.csdn.net/notbaron/article/details/47211637 1.  折半查找 折半查找要求查找表用顺序存储结构存放且各数据元素按关键字有序(升序或隆序)排列,也就是说折半查找只适用于对有序顺序表进行查找. 折半查找的基本思想是:首先以整个查找表作为查找范围,用查找条件中给定值k与中间位置

Android 进阶学习:事件分发机制全然解析,带你从源代码的角度彻底理解(上)

http://blog.csdn.net/guolin_blog/article/details/9097463 事实上我一直准备写一篇关于Android事件分发机制的文章,从我的第一篇博客開始,就零零散散在好多地方使用到了Android事件分发的知识.也有好多朋友问过我各种问题,比方:onTouch和onTouchEvent有什么差别,又该怎样使用?为什么给ListView引入了一个滑动菜单的功能,ListView就不能滚动了?为什么图片轮播器里的图片使用Button而不用ImageView?

SQL Server 2008从基础开始学习历程(1)------创建表与查询

[by:yy] 无论我们学什么呢,都要讲究一个Why,一个How.那么我们为什么要学SQL呢?无非就那么几点. 1.为了适应其他技术,和其他技术配对而学. 我个人的理解呢,只要在IT行业,无论你学什么,或者做什么工作.都离不开数据库.而学习数据库呢,又太文字化了,看的心里就烦.我是很抵触文字的.看着一大排一大排的字,就怕.可能是大天朝的教育所致.已经怕了学生生涯了. 2.为了适应社会而学. 随便找个招聘信息,都会有标注需要会SQL语言啊.了解MySql呀.会搞Oracle呀.所以呢,为了能在找工

Silverlight学习(四) domainservice动态多条件查询

上次讲了silverlight+MVVN+EF的简单框架,能够实现简单的数据CURD,但是多条件动态的查询一直没有实现.在网上查阅了很多资料,发现自己走了很多误区,代码很难调试正确. 这次的查询是基于上次的查询,只是增加了一个查询条件,动态多条件的查询的重点是获取查询的语言. 1 private string GetSql() 2 { 3 string query = "1=1"; 4 if (!string.IsNullOrEmpty(searchText.name)) 5 { 6

MySQL学习笔记(五)—— 子查询及联结

子查询: 子查询,即嵌套在其他查询中的查询.例如我们有这样几个表,顾客表,订单表,商品表,我们想知道有哪些客户买了商品A,那么我们就需要先查看哪些订单里包含了商品A,然后根据订单查出是哪些客户. mysql> select cust_id from orders where order_num in (select order_num from orderitems where prod_id = '1'); +---------+ | cust_id | +---------+ |    10

2、蛤蟆的数据结构进阶二静态查询之顺序查询

2.蛤蟆的数据结构进阶二静态查询之顺序查询 本篇名言:"我从不把安逸和快乐看作是生活的本身 --这种伦理基础,我叫它猪栏的理想. --爱因斯坦" 这篇我们来看下静态查询中的顺序表查询. 我们先来看下概念,然后是代码实现. 欢迎转载,转载请标明出处:http://blog.csdn.net/notbaron/article/details/47175103 1.  查找 在计算机科学中定义为:在一些(有序的/无序的)数据元素中,通过一定的方法找出与给定关键字相同的数据元素的过程叫做查找.

MongoDB 学习笔记(二) 之查询

最简单的查询 个人认为mongoDB是面向对象的吧. 例如最简单的查询  整个数据集只有三条数据 第一查询姓名为张三的  数据 查询的条件比较好写 随意   db.collection.find(查询条件)   例如 15 得到的结果是这样 如果你不想返回某个字段呢 ,你可以自己定义返回的字段值 语法这样 db.collection.find({查询条件},{返回字段}) 16 我们看到每次查询 "_id" 这个字段 都返回  我们可以将它设置为0 这样的话就不会返回 如 查询条件里的