base command of linux



 

i m very happy and honor to tell you sth about linux shell,linux shell is easy to learn ,

      as a beginner,you just need to know these commands as below:

      

 ls 

 ls -l

 ls -a

 cd mydir

 cd ..

 whoami

 cd ../..

 cd ../../..

 cd ~/love/you/

 mkdir mydir

 touch myfile.txt

 pwd 



 

to extend this,please know:

 

ls :    list the files and directories under current directory;

 

ls -l : list the files and directories under current directory,and show more infomations

        about them,such as created time,size,etc...        

        

ls -a : list all the files and directories under current directory,include those hidden files 

        and directories,you know ,just as windows,some files and directories are hiddened in linux

 

cd mydirName: it means in current directory,there must be a directory named "mydir",

              if you want to open it ,use this command.

              and if no directory named "mydir" ,the linux terminal will tell you some infomations

              on the screen,such as below:

              wow,there are no such a directory.maybe you input a error name,plese check...

 

cd .. : if you want to go to the father directory of the current directory,use this ,for exeample,

        if you are located in ~/01/02/03 now,and you want to go to ~/01/02,then you use this command. 

        may be you have a question is that what is the "~" means,actually it is a path of current user,

        because a computer can have many users,and they have there own account,but they have the same 

        top path , that is "/home",we can not miss the "/",because it is the root,just like a root

        of a tree,every path's t highest father is the "/",we use the /home/username to show the 

        path of a user,such as "/home/tom","/home/baby","/home/jerry8801","/home/imthemosthandsome", 

        and "~" is the abbreviation of them , instead of the very long path,"~" is  more easy to use; 

        for example, if current user is tom,so "~" means "/home/tom" or "/home/tom/",

        the last "/" in linux shell may or may not exist,there are no difference. 

        

whoami: it means who am i ,the command tell you who is the current user.

 

cd ../.. : go to father's father's directory

 

cd ../../..:go to father's father's father's directory

 

cd ~/love/you/: if current user is tom ,so the command means open the path of "/home/tom/love/you" 

 

mkdir mydir: make a new directory named "mydir" ,for example,mkdir mimi,mkdir pp.kk,mkdir du999,

             mkdir pp.kk will make a directory named "pp.kk",its not a file ,but a directory,

             you can use "cd pp.kk" to enter the directory.

 

touch  myfile.txt: make a new file mamed "myfile.txt",of course ,any file suffix name is ok,

                   for example,touch my.txt,touch you.h ,touch baby.kk,touch lulu.lala,

                   touch iloveyou.py,touch 10087.cpp,touch hello.c ,etc...

 

pwd: show the current path where you are  located in now ,for example,if you are in ~/i/love/you ,

     and when you input the command and press enter,the terminal will return some info to you

     as below:

     /home/baby/i/love/you

    


 

of course,dont forget to press enter after input any command in the linux shell,

when you press enter,the comuputer will run your command,if you dont press enter ,

the computer will wait for 2000 years.

and what is "linux shell",or what is "terminal",ok ,it is a playground which not only

afford you a place to input your command,but also return command results to you.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章