Command line(1)

Before studying the command line, we should know something about linux and ubuntu.

Linux

Linux is a Unix-like computer operating system assemble under the model of free and open-source software development and distribution, the defining component of linux is the linux kernel.(from Wikipedia)

Ubuntu

Ubuntu is a Debian-based Linux operating system for personal computer, tables and smartphones, where Ubuntu Touch Edition is used.
Ubuntu this word is also based on free software and named after the Southern African philosophy of ubuntu,
can be translated as "humanity to others" or "I am what I am because of who we all are".

** Commitment of Ubuntu**
It is the essential reasons for the success of Ubuntu.

  • Ubuntu is free forever, including commercial distrubution and security update.
  • Ubuntu is provided business support by Canonical and global hundreds of companies.
  • Ubuntu has the free software communtiy, which provides the best translation and barrier-free facilities.
  • The Ubuntu is publicly committed to the principles of open source software development ; people are encouraged to use free software, study how it works, improve upon it, and distribute it.

Command line

Linux command is to supervise and control the Linux system. The commonly used command are as follows.

cd——Change Directory
cd        -enter main directory
cd /home  -enter '/home'  directory
cd ..     - return to higher level directory
pwd——Print Working Directory
ls——List
ls        -list the files in the directory
ls -f     -classify the directory and files
ls -l     -list detail of the files and directory
ls -a     -list the hidden files
mkdir——Make Directory
mkdir dir1         -make a directory named dir1
mkdir dir1 dir2    -make two directory
rm——remove files
rmdir——remove directory
rm -f file1    -remove a file named file1
rmdir dir1     -remove dir1 directory if it's empty
rm -rf dir1    -remove dir1 directory and its contents
cp——copy files
cp file1 directory  -copy file1 to  directory
cp -a dir1 dir2     -copy a directory
mv——move
mv dir1 new_dir   -rename or remove to another directory
tar
tar -cvf archive.tar file1              -create a incompressible tarball
tar -cvf archive.tar file1 file2 dir1   -create a archive file including file1 file2 and dir1
tar -tf archive.tar                     -show a tarball content
ar -xvf archive.tar                     -decompress a tarball
tar -xvf archive.tar -C /tmp            -decompress a tarball on the tmp
 tar -cvfj archive.tar.bz2 dir1         -create a bzip2 format tarball
tar -xvfj archive.tar.bz2               -decompress a bzip2 format tarball
 tar -cvfz archive.tar.gz dir1          -create a gzip format tarball
 tar -xvfz archive.tar.gz               -decompress a gzip format tarball
zip
zip file1.zip file1    -create a zipball
zip -r file1.zip file1 file2 dir1 
unzip file1.zip        -decompress a zipball
grep
grep string1 file1       -search string1 in file1
grep -i string1 file1    -search string1 in file1 ignore case
tail
tail file1      -cat last 10 line of file1
tail -n file1   -cat last 2 lien of file1
su
su user1   -switch user
apt-get
apt-get install package_name       -install or update a deb package
apt-get update                     -update deb packages in the list
apt-get upgrade                    -upgrade all the installed package
apt-get remove package_name        -remove a package form system
apt-get clean                      -clean cache from the software package
ps :show the operating processes
top
top -u use
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末友鼻,一起剝皮案震驚了整個濱河市妈候,隨后出現的幾起案子目养,更是在濱河造成了極大的恐慌,老刑警劉巖嫉髓,帶你破解...
    沈念sama閱讀 217,826評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件观腊,死亡現場離奇詭異,居然都是意外死亡算行,警方通過查閱死者的電腦和手機梧油,發(fā)現死者居然都...
    沈念sama閱讀 92,968評論 3 395
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來州邢,“玉大人儡陨,你說我怎么就攤上這事×刻剩” “怎么了骗村?”我有些...
    開封第一講書人閱讀 164,234評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長呀枢。 經常有香客問我胚股,道長,這世上最難降的妖魔是什么硫狞? 我笑而不...
    開封第一講書人閱讀 58,562評論 1 293
  • 正文 為了忘掉前任信轿,我火速辦了婚禮,結果婚禮上残吩,老公的妹妹穿的比我還像新娘财忽。我一直安慰自己,他們只是感情好泣侮,可當我...
    茶點故事閱讀 67,611評論 6 392
  • 文/花漫 我一把揭開白布即彪。 她就那樣靜靜地躺著,像睡著了一般活尊。 火紅的嫁衣襯著肌膚如雪隶校。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,482評論 1 302
  • 那天蛹锰,我揣著相機與錄音深胳,去河邊找鬼。 笑死铜犬,一個胖子當著我的面吹牛舞终,可吹牛的內容都是我干的。 我是一名探鬼主播癣猾,決...
    沈念sama閱讀 40,271評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼敛劝,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了纷宇?” 一聲冷哼從身側響起夸盟,我...
    開封第一講書人閱讀 39,166評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎像捶,沒想到半個月后上陕,有當地人在樹林里發(fā)現了一具尸體桩砰,經...
    沈念sama閱讀 45,608評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,814評論 3 336
  • 正文 我和宋清朗相戀三年唆垃,在試婚紗的時候發(fā)現自己被綠了五芝。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,926評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡辕万,死狀恐怖枢步,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情渐尿,我是刑警寧澤醉途,帶...
    沈念sama閱讀 35,644評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站砖茸,受9級特大地震影響隘擎,放射性物質發(fā)生泄漏。R本人自食惡果不足惜凉夯,卻給世界環(huán)境...
    茶點故事閱讀 41,249評論 3 329
  • 文/蒙蒙 一货葬、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧劲够,春花似錦震桶、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,866評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至人柿,卻和暖如春柴墩,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背凫岖。 一陣腳步聲響...
    開封第一講書人閱讀 32,991評論 1 269
  • 我被黑心中介騙來泰國打工江咳, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人哥放。 一個月前我還...
    沈念sama閱讀 48,063評論 3 370
  • 正文 我出身青樓歼指,卻偏偏與公主長得像,于是被迫代替她去往敵國和親婶芭。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 44,871評論 2 354

推薦閱讀更多精彩內容