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
    原文作者:jiadudu
    原文地址: https://www.jianshu.com/p/192435e6a6dc
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞