CD/: Entry root directory
-----------------------
[Email protected]:/etc$ CD/
[Email protected]:/$ pwd
CD ~: Entry user root directory
----------------------
[Email protected]:/$ CD ~
[Email protected]:~$ pwd
/home/tangym
ls : List all files.
pwd : Show current directory
cd/home : Entry Home Directory
CD : Entry The last parent directory
Cat Fstab: Show the text file content.
Cat FS, then press <tab>.Shell would fill the whole file name automtically.
ls m*: List all the file name starts WITH:M
ls magi?: List all the file name starts With:magi and following one character.
Like:magic
ls M*[od]: List all starts with:m, end With:o or D.
ls-l: Show all file ' s properties:
-------------------------
[Email protected]:~$ ls-l
Total 204112
Drwxr-xr-x 2 Tangym tangym 4096
Drwxr-xr-x 2 Tangym tangym 4096
Drwxr-xr-x 3 Tangym tangym 4096 08:53 Downloads
-rw-r--r--1 tangym tangym 8445 examples.desktop
-rw-rw-r--1 tangym tangym 10240 Jan ez_setup.py
Drwxr-xr-x 2 Tangym tangym 4096
Drwxr-xr-x 2 Tangym tangym 4096 Pictures
Drwxr-xr-x 2 Tangym tangym 4096
Dir:show All Files
Vdir:show all files and its properties
Cat-n. bashrc:show file content with rowcount
---------------------------
[Email protected]:~$ cat-n. BASHRC
1 # ~/.bashrc:executed by Bash (1) for non-login shells.
2 # See/usr/share/doc/bash/examples/startup-files (in the package bash-doc)
3 # for examples
4
More . BASHRC : Show file content in separate page.
----------------
[Email protected]:~$ more. BASHRC
# ~/.bashrc:executed by Bash (1) for non-login shells.
# See/usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
head-n 5. BASHRC : Show first 5 row content
tail-n 5. BASHRC : Show last 5 row content.
grep PS1. BASHRC : Find all row content With:ps1
------------------------
[Email protected]:~$ grep PS1. BASHRC
[-Z "$PS 1"] && return
Ps1= ' ${debian_chroot:+ ($debian _chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[ 00m\]\$ '
Ps1= ' ${debian_chroot:+ ($debian _chroot)}\[email protected]\h:\w\$ '
Ps1= "\[\e]0;${debian_chroot:+ ($debian _chro
find./-name *bash* : Find file name With:bash in current directory.
-----------------------------
[Email protected]:~$ find./-name *bash*
./.bash_history
./.BASHRC
./.bash_logout
./redis-py-master/vagrant/.bash_profile
./downloads/redis-py-master/vagrant/.bash_profile
[Email protected]:~$ Locate bash//similar to find. Find File/directory With:back
[Email protected]:~$ sudo updatedb//force update local db for Locate command
[email protected]:~$ firefox www.baidu.com:open firefox webbrowser
Whereis Find : Get command ' s notebook
-------------------------------
[Email protected]:~$ whereis find:get Notebook
Find:/usr/bin/find/usr/bin/x11/find/usr/share/man/man1/find.1.gz
[Email protected]:~$ whereis-b Find
---------------Get Executable Program
Find:/usr/bin/find/usr/bin/x11/find
-------------------------------
which LS: find where is ls command
------------------------------
[email protected]:~$ which LS
/bin/ls
-----------------------------
who
WhoAmI
uname
uname-a
uname-r : Kernel version
----------------------------
[email protected]:~$ who
tangym tty7 2016-05-23 23:50
tangym pts/1 2016-05-23 23:50 (: 0)
tangym pts/2 2016-05-23 23:58 (: 0)
tangym pts/ 3 2016-05-23 23:59 (: 0)
tangym pts/4 2016-05-24 19:49 (: 0)
[email protected]:~$ Who am I
tangym PTS/4 2016-05-24 19:49 (: 0)
[email protected]:~$ whoami
Tangym
[email protected]:~$ uname
Linux
[email protected]:~$ uname-a
Linux ubuntu 3.2.0-29-generic #46- Ubuntu SMP Fri Jul 17:03:23 UTC x86_64 x86_64 x86_64 gnu/linux
-------------------------------
Man find : Get the Find command decription
-------------------------------
[Email protected]:~$ man Find
--------------------------------
whatis ls: Get the command common usage.
-------------------------------
[Email protected]:~$ whatis ls
LS (1)-List Directory contents
-------------------------------
This article is from the "Software Design and Development" blog, please be sure to keep this source http://yuanzhitang.blog.51cto.com/2769219/1782968
Linux Shell Command (Quick Study)