2014年3月19日星期三

Linux Commands for Beinners lesson 1 -- cd,ls,pwd

 declaration:This series of articles is written for linux beginners.
      
             linux command isn't as mysterious as many people think.In fact ,using linux command just as easy as using Windows system.For most linux beginner,they may choose a book named Learning Linux Command  From Entry To Master,which was written like an operation manual.It just scared themselvies.Therefore,in this series,I just shortly introduce some useful Linux commands.




1.command:
     cd = Change Directory
2.command:
     ls = list directory contents


  SYNOPSIS:
          ls [OPTION]... [FILE]...
  in here,I just introduce two options:
  -a:all
  -l:use a long listing format



3.command:
  pwd = Print Working Directory 
  


 Example1-2:
piniheaven@fish:~$ ls       #list contents in current directory
Desktop  Documents  Downloads  examples.desktop  Music  Pictures  Public  SolftWares  Templates  Ubuntu One  Videos
piniheaven@fish:~$ ls Documents/         #list contents in Documents folder
assemble  C++primer_ex  C++primer_note  Ebook  linux  QT_ex  QT_note
piniheaven@fish:~$ cd Documents/      #change directory to Documents/  
piniheaven@fish:~/Documents$ ls -l    #list contents in current directory using long listing format
total 28
drwxrwxr-x  3 piniheaven piniheaven 4096 Aug 16 19:26 assemble
drwxrwxr-x  2 piniheaven piniheaven 4096 Jul 19 14:12 C++primer_ex
drwxrwxr-x  2 piniheaven piniheaven 4096 Jul 20 07:49 C++primer_note
drwxrwxr-x  6 piniheaven piniheaven 4096 Jul 19 11:18 Ebook
drwxrwxr-x  2 piniheaven piniheaven 4096 Aug 19 18:07 linux
drwxrwxr-x 11 piniheaven piniheaven 4096 Jul 19 09:13 QT_ex
drwxrwxr-x  2 piniheaven piniheaven 4096 Jul 19 00:21 QT_note
piniheaven@fish:~/Documents$ ls -a   #list all contents in current directory
.  ..  assemble  C++primer_ex  C++primer_note  Ebook  linux  QT_ex  QT_note
piniheaven@fish:~/Documents$ ls -la   #list all contents in current directory using long listing format
total 36
drwxr-xr-x  9 piniheaven piniheaven 4096 Aug 19 16:22 .
drwxr-xr-x 33 piniheaven piniheaven 4096 Aug 20 09:04 ..
drwxrwxr-x  3 piniheaven piniheaven 4096 Aug 16 19:26 assemble
drwxrwxr-x  2 piniheaven piniheaven 4096 Jul 19 14:12 C++primer_ex
drwxrwxr-x  2 piniheaven piniheaven 4096 Jul 20 07:49 C++primer_note
drwxrwxr-x  6 piniheaven piniheaven 4096 Jul 19 11:18 Ebook
drwxrwxr-x  2 piniheaven piniheaven 4096 Aug 19 18:07 linux
drwxrwxr-x 11 piniheaven piniheaven 4096 Jul 19 09:13 QT_ex
drwxrwxr-x  2 piniheaven piniheaven 4096 Jul 19 00:21 QT_note
piniheaven@fish:~/Documents$ cd..   #change directory to previous folder
piniheaven@fish:~$ cd/          #change directory to root
piniheaven@fish:/$ cd ~          #change directory to user
piniheaven@fish:~$ cdDocuments/assemble/
piniheaven@fish:~/Documents/assemble$ cd #change directory to user
piniheaven@fish:~$ pwd  #Print current Working Directory
/home/piniheaven
piniheaven@fish:~$ cdDocuments/assemble/
piniheaven@fish:~/Documents/assemble$ pwd
/home/piniheaven/Documents/assemble

没有评论:

发表评论