linux命令(1)

cd

[jiaxin@centos6 ~]$ cd src
[jiaxin@centos6 src]$ cd -
/home/jiaxin

pwd

[jiaxin@centos6 ~]$ pwd
/home/jiaxin

rm

[jiaxin@centos6 ~]$ rm -r zuoye
[jiaxin@centos6 ~]$ cd zuoye
-bash: cd: zuoye: No such file or
-rw-r--r-- 1 jiaxin trainning 0 Nov 18 00:09 hh
[jiaxin@centos6 ~]$ ls zuoye2
hehe  hh
[jiaxin@centos6 ~]$ rm zuoye2
rm: cannot remove `zuoye2': Is a directory
[jiaxin@centos6 ~]$ rmdir zuoye2
rmdir: failed to remove `zuoye2': Directory not empty
[jiaxin@centos6 ~]$ rm -r zuoye2
[jiaxin@centos6 ~]$ ls zuoye2
ls: cannot access zuoye2: No such file or directory

mv

[jiaxin@centos6 ~]$ touch hehe
[jiaxin@centos6 ~]$ mv hehe hh
[jiaxin@centos6 ~]$ mv hh zuoye2
[jiaxin@centos6 ~]$ ls zuoye2/hh
zuoye2/hh

rm

[jiaxin@centos6 ~]$ rm haha

cp

[jiaxin@centos6 ~]$ cp zuoye2/hh zuoye2/hehe
[jiaxin@centos6 ~]$ ls zuoye2/hehe
zuoye2/hehe
[jiaxin@centos6 ~]$ vim haha

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

cat

[jiaxin@centos6 ~]$ cat haha
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

more

[jiaxin@centos6 ~]$ more haha
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

less

[jiaxin@centos6 ~]$  less haha
1
1
1
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

[jiaxin@centos6 ~]$ head -n 5 haha
1
2
3
4
5
[jiaxin@centos6 ~]$ head -n -10 haha
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[jiaxin@centos6 ~]$ tail -n +10 haha
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

date

[jiaxin@centos6 ~]$ date
Mon Nov 18 01:20:20 CST 2013
[jiaxin@centos6 ~]$ date +%Y/%m/%d/%H:%M:%S
2013/11/18/01:32:08

umask

[jiaxin@centos6 ~]$ umask
0022
[jiaxin@centos6 ~]$ ll haha
-rw-r--r-- 1 jiaxin trainning 64 Nov 18 00:44 haha
[jiaxin@centos6 ~]$ umask 0000
[jiaxin@centos6 ~]$ touch xixi
[jiaxin@centos6 ~]$ ll xixi
-rw-rw-rw- 1 jiaxin trainning 0 Nov 18 12:51 xixi
[jiaxin@centos6 ~]$ umask 0022
[jiaxin@centos6 ~]$ rm xixi

locate

[jiaxin@centos6 ~]$ locate haha
/home/jiaxin/haha

whereis

[jiaxin@centos6 ~]$ whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz

which

[jiaxin@centos6 ~]$ which touch
/bin/touch

man

[jiaxin@centos6 ~]$ man ls
LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents

SYNOPSIS
       ls [OPTION]... [FILE]...

DESCRIPTION
       List  information  about  the  FILEs  (the  current directory by
       default).  Sort entries alphabetically if none of -cftuvSUX  nor
       --sort.

       Mandatory  arguments  to  long  options  are mandatory for short
       options too.

       -a, --all
              do not ignore entries starting with .

       -A, --almost-all
              do not list implied . and ..

       --author
              with -l, print the author of each file

       -b, --escape
:

expr

[jiaxin@centos6 ~]$ expr 1 + 2
3
[jiaxin@centos6 ~]$ expr 1 \* 2
2
[jiaxin@centos6 ~]$ expr 1 / 2
0
[jiaxin@centos6 ~]$ expr 1 % 2
1

touch

[jiaxin@centos6 ~]$ ll haha
-rw-r--r-- 1 jiaxin trainning 64 Nov 18 00:44 haha
[jiaxin@centos6 ~]$ touch  haha
[jiaxin@centos6 ~]$ ll haha
-rw-r--r-- 1 jiaxin trainning 64 Nov 18 15:15 haha

od

[jiaxin@centos6 ~]$ od -c  /bin/ls
0054220  \0  \0  \0   A 367 306  \0 004  \0  \0   t 027 277 021  \0  \0
0054240  \0 350 352 330 377 377 204 300 272 020 001  \0  \0 017 205 223
0054260 375 377 377 277 025  \0  \0  \0 350 323 330 377 377 204 300   t
0054300 022 200 273 270  \0  \0  \0  \0 272   P 001  \0  \0 017 205   s
0054320 375 377 377   A 203 346   I 017 205 264  \0  \0  \0   H 203   {
0054340     001 017 206   ] 376 377 377 277 026  \0  \0  \0 350 236 330
0054360 377 377 204 300 272   ` 001  \0  \0 017 205   G 375 377 377 351
0054400   A 376 377 377   H 203 303 020 351   D 375 377 377   D 211 360
0054420   % 002 002  \0  \0   = 002 002  \0  \0 017 204 215  \0  \0  \0
0054440   A 366 306 002   u   9   A 201 346  \0 002  \0  \0   u   I 272
0054460   `  \0  \0  \0 351  \r 375 377 377 272 377 377 377 377 351 334
0054500 375 377 377 277 020  \0  \0  \0 350   C 330 377 377 204 300 272
0054520  \0 001  \0  \0 017 205 354 374 377 377 351   4 377 377 377 277
0054540 023  \0  \0  \0 350   ' 330 377 377 204 300 272   0 001  \0  \0
0054560 017 205 320 374 377 377 353 256 277 022  \0  \0  \0 350 016 330
0054600 377 377 204 300 272     001  \0  \0 017 205 267 374 377 377 353
0054620 236 277 016  \0  \0  \0 350 365 327 377 377 204 300 272 340  \0
0054640  \0  \0 017 205 236 374 377 377 351   0 377 377 377 277 024  \0
.......

find
[jiaxin@centos6 ~]$ find /home/jiaxin -name haha
/home/jiaxin/haha

chmod

[jiaxin@centos6 ~]$ ll haha
-rw-r--r-- 1 jiaxin trainning 64 Nov 18 15:15 haha
[jiaxin@centos6 ~]$ chmod u+x haha
[jiaxin@centos6 ~]$ ll haha
-rwxr--r-- 1 jiaxin trainning 64 Nov 18 15:15 haha
[jiaxin@centos6 ~]$ chmod 644 haha
[jiaxin@centos6 ~]$ ll haha
-rw-r--r-- 1 jiaxin trainning 64 Nov 18 15:15 haha

ln

[jiaxin@centos6 ~]$ mkdir test1 && touch test1/text1
[jiaxin@centos6 ~]$ ln -s test/ ttt
[jiaxin@centos6 ~]$ ll ttt
lrwxrwxrwx 1 jiaxin trainning 5 Nov 21 02:13 ttt -> test/
[jiaxin@centos6 ~]$ rm -r ttt test
[jiaxin@centos6 ~]$ ll ttt
ls: cannot access ttt: No such file or directory
[jiaxin@centos6 ~]$ mkdir test1 && touch test1/text1
[jiaxin@centos6 ~]$ ll ttt
lrwxrwxrwx 1 jiaxin trainning 5 Nov 21 02:09 ttt -> test/
[jiaxin@centos6 ~]$ rm -rf ttt test1/
[jiaxin@centos6 ~]$ ll ttt
ls: cannot access ttt: No such file or directory
[jiaxin@centos6 ~]$ ll test1
ls: cannot access test1: No such file or directory

basename

[jiaxin@centos6 ~]$ basename /home/jiaxin/haha
haha

dirname

[jiaxin@centos6 ~]$ dirname /home/jiaxin/haha
/home/jiaxin


cut

[jiaxin@centos6 ~]$ vim hh

1234567
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
~                                                                             
"hh" [New] 1L, 8C written                                   
[jiaxin@centos6 ~]$ cut -c 1-2 hh
12

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值