1.copy
[root@localhost ~]# cp /root/Desktop/file /root/Desktop/folder
2.move
[root@localhost ~]# mv /root/Desktop/file /root/Desktop/folder
3.remove
[root@localhost ~]# rm /root/Desktop/folder/file
rm: remove regular file `/root/Desktop/folder/file'? y
4.Make dir
[root@localhost ~]# mkdir /root/Desktop/folder
[root@localhost bin]# mkdir -p -m 700 /root/Desktop/xiaomao
5.remove dir
[root@localhost ~]# rmdir /root/Desktop/folder
rmdir: /root/Desktop/folder: Directory not empty
[root@localhost ~]# rmdir /root/Desktop/folder
6.chang dir
[root@localhost /]# cd /root/Desktop/folder/
[root@localhost folder]# cd ../..
[root@localhost ~]# cd ../..
[root@localhost /]# cd ~
[root@localhost ~]#
7.pwd
[root@localhost ~]# cd /root/Desktop/folder
[root@localhost folder]# pwd
/root/Desktop/folder
8.list
[root@localhost folder]# ls /root/Desktop/folder
new file untitled folder 1 untitled folder 3
untitled folder untitled folder 2
[root@localhost ~]# ls -al
total 288
drwxr-x--- 17 root root 4096 Feb 14 20:55 .
drwxr-xr-x 24 root root 4096 Feb 14 17:01 ..
-rw------- 1 root root 912 Feb 9 03:31 anaconda-ks.cfg
-rw------- 1 root root 6090 Feb 14 17:24 .bash_history
-rw-r--r-- 1 root root 24 Jul 12 2006 .bash_logout
-rw-r--r-- 1 root root 191 Jul 12 2006 .bash_profile
-rw-r--r-- 1 root root 176 Jul 12 2006 .bashrc
drwx------ 3 root root 4096 Feb 13 18:26 .config
-rw-r--r-- 1 root root 100 Jul 12 2006 .cshrc
drwx------ 3 root root 4096 Feb 14 2012 .dbus
drwxr-xr-x 7 root root 4096 Feb 14 17:24 Desktop
-rw------- 1 root root 26 Feb 8 21:25 .dmrc
drwxr-x--- 2 root root 4096 Feb 8 21:25 .eggcups
-rw------- 1 root root 16 Feb 14 17:24 .esd_auth
drwx------ 4 root root 4096 Feb 14 20:54 .gconf
drwx------ 2 root root 4096 Feb 14 20:56 .gconfd
drwxr-xr-x 3 root root 4096 Feb 8 21:25 .gnome
drwx------ 8 root root 4096 Feb 14 19:21 .gnome2
drwx------ 2 root root 4096 Feb 8 21:25 .gnome2_private
drwxr-xr-x 2 root root 4096 Feb 8 21:25 .gstreamer-0.10
-rw-r--r-- 1 root root 81 Feb 8 21:25 .gtkrc-1.2-gnome2
-rw------- 1 root root 569 Feb 14 20:54 .ICEauthority
-rw-r--r-- 1 root root 26586 Feb 9 03:31 install.log
-rw-r--r-- 1 root root 3488 Feb 9 03:29 install.log.syslog
drwx------ 3 root root 4096 Feb 8 21:25 .metacity
drwxr-xr-x 3 root root 4096 Feb 14 19:21 .nautilus
-rw-r--r-- 1 root root 4517 Feb 14 20:55 .recently-used.xbel
drwxr-xr-x 3 root root 4096 Feb 8 21:25 .redhat
-rw-r--r-- 1 root root 129 Jul 12 2006 .tcshrc
drwx------ 3 root root 4096 Feb 13 18:25 .thumbnails
drwx------ 11 root root 4096 Feb 14 16:51 .Trash
-rw-r--r-- 1 root root 1346 Feb 14 20:54 .xsession-errors
[root@localhost ~]# ls --version
ls (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard Stallman and David MacKenzie.
[root@localhost Desktop]# ls>file1
[root@localhost Desktop]# cate file1
bash: cate: command not found
[root@localhost Desktop]# cat file1
fcitx-3.6.3.tar.tar
file
file~
file1
file1~
file2
file2~
file2.zip
file.tar.gz
folder
folder1
folder2
folder3
folder4
[root@localhost Desktop]# cat file2
a
hi
who are you
???
[root@localhost Desktop]# ls>>file2
[root@localhost Desktop]# cat file2
a
hi
who are you
???
fcitx-3.6.3.tar.tar
file
file~
file1
file1~
file2
file2~
file2.zip
file.tar.gz
folder
folder1
folder2
folder3
folder4
9.sort
[root@localhost Desktop]# sort file2
1
5
8
9
9
[root@localhost Desktop]# sort file2
a
b
c
h
j
[root@localhost Desktop]# sort -d file2
???
hi
i am ann
who are you
10.uniq
[root@localhost Desktop]# cat file2
you are beautiful
you are beautiful
you are a boy
why
[root@localhost Desktop]# uniq file2
you are beautiful
you are a boy
why
11.tar
[root@localhost Desktop]# tar -cvf /root/Desktop/folder.tar folder
folder/
folder/folder/
folder/folder/new m,mmfile
folder/untitled folder 2/
folder/new file
folder/file2
folder/untitled folder 3/
folder/untitled folder 1/
[root@localhost Desktop]# tar -zcvf /root/Desktop/folder.tar folder
folder/
folder/folder/
folder/folder/new m,mmfile
folder/untitled folder 2/
folder/new file
folder/file2
folder/untitled folder 3/
folder/untitled folder 3/file2
folder/untitled folder 1/
[root@localhost Desktop]# tar -jcvf /root/Desktop/folder.tar folder
folder/
folder/folder/
folder/folder/new m,mmfile
folder/untitled folder 2/
folder/new file
folder/file2
folder/untitled folder 3/
folder/untitled folder 3/file2
folder/untitled folder 1/
12.gzip
[root@localhost folder]# gzip *
gzip: file2.gz already has .gz suffix -- unchanged
gzip: folder is a directory -- ignored
gzip: new file.gz already has .gz suffix -- unchanged
gzip: untitled folder 1 is a directory -- ignored
gzip: untitled folder 2 is a directory -- ignored
gzip: untitled folder 3 is a directory -- ignored
[root@localhost folder]# gzip -dv *
file2.gz: 38.9% -- replaced with file2
gzip: folder is a directory -- ignored
[root@localhost folder]# ls
file2 folder
[root@localhost folder]# gzip -l *
gzip: file2: not in gzip format
gzip: folder is a directory -- ignored
[root@localhost Desktop]# gzip file.tar
[root@localhost Desktop]# ls
file file.tar.gz folder
13.unzip
[root@localhost Desktop]# unzip file2.zip
Archive: file2.zip
inflating: crash.dmp
inflating: errorlog.txt
[root@localhost Desktop]# unzip -n file2.zip -d /folder
Archive: file2.zip
inflating: /folder/crash.dmp
inflating: /folder/errorlog.txt
[root@localhost Desktop]# unzip -v file2.zip
Archive: file2.zip
Length Method Size Ratio Date Time CRC-32 Name
-------- ------ ------- ----- ---- ---- ------ ----
55722 Defl:N 18957 66% 02-06-12 20:14 321fd8fc crash.dmp
556 Defl:N 345 38% 02-06-12 20:15 9e9875be errorlog.txt
-------- ------- --- -------
56278 19302 66% 2 files
14.chmod
[root@localhost Desktop]# chmod u+r file
[root@localhost Desktop]# chmod go-r file
[root@localhost Desktop]# su a
[a@localhost Desktop]$ cd file
bash: cd: file: Permission denied
(as same as
[root@localhost Desktop]# chmod u+rw,og-rw file
)
15.chgrp
[root@localhost Desktop]# chgrp users file
[root@localhost Desktop]# ls -l
total 56
-rw------- 1 root users 3605 Feb 9 23:53 file
-rw------- 1 root root 3346 Feb 9 01:29 file~
-rwxrw-rw- 1 root root 19808 Feb 6 20:15 file2.zip
-rw-r--r-- 1 root root 510 Feb 9 00:39 file.tar.gz
drwxr-xr-x 3 root root 4096 Feb 9 00:36 folder
16.passwd
[root@localhost ~]# passwd a
Changing password for user a.
New UNIX password:
17.su
[root@localhost ~]# su a
[a@localhost root]$ su root
Password:
[root@localhost ~]#
[a@localhost root]$ su - a
Password:
18.wall
[root@localhost ~]# wall hi
Broadcast message from root (pts/1) (Fri Feb 10 00:25:54 2012):
hi
[root@localhost ~]# wall 'hi handsun guy'
Broadcast message from root (pts/1) (Fri Feb 10 00:26:31 2012):
hi handsun guy
[root@localhost ~]# cd /root/Desktop/
[root@localhost Desktop]# cat file1
hi,pretty girl
[root@localhost Desktop]# wall file1
Broadcast message from root (pts/1) (Fri Feb 10 00:30:11 2012):
file1
19.write
[a@localhost root]$ su - a
Password:
[a@localhost ~]$ write root pts/2
Message from root@localhost.localdomain (as a) on pts/2 at 01:17 ...
EOF
[a@localhost ~]$ write root
hello baby
[a@localhost ~]$
[root@localhost ~]#
Message from root@localhost.localdomain (as a) on pts/2 at 01:20 ...
hello baby
20.mesg
[root@localhost ~]# mesg
is y
[root@localhost ~]# mesg n
[root@localhost ~]# mesg
is n
21.sync
[root@localhost ~]# sync
[root@localhost ~]#
22.shutdown
[root@localhost ~]# shutdown -r +10
Broadcast message from root (pts/1) (Mon Feb 13 17:44:48 2012):
The system is going DOWN for reboot in 10 minutes!
Shutdown cancelled.
23.free
[root@localhost ~]# free -k
total used free shared buffers cached
Mem: 515308 508936 6372 0 29148 348808
-/+ buffers/cache: 130980 384328
Swap: 1044184 0 1044184
[root@localhost ~]# free -m
total used free shared buffers cached
Mem: 503 497 6 0 28 340
-/+ buffers/cache: 127 375
Swap: 1019 0 1019
24.uptime
[root@localhost ~]# uptime
18:04:02 up 32 min, 2 users, load average: 0.25, 0.15, 0.18
25.df
[root@localhost ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 3960348 1955460 1800464 53% /
/dev/sda3 15289132 170356 14329584 2% /home
/dev/sda1 46633 10688 33537 25% /boot
tmpfs 257652 0 257652 0% /dev/shm
.host:/ 52548612 3776928 48771684 8% /mnt/hgfs
You have new mail in /var/spool/mail/root
26.du
[root@localhost ~]# du -kb Desktop
4096 Desktop/folder/folder
8249 Desktop/folder
42320 Desktop
27.echo
[root@localhost folder]# echo hi
hi
28.cal
[root@localhost folder]# cal
February 2012
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29
29.date
[root@localhost folder]# date
Mon Feb 13 19:05:46 PST 2012
30.clear
31.who
[root@localhost ~]# who
root :0 2012-02-13 23:31
root pts/1 2012-02-13 23:32 (:0.0)
[root@localhost ~]# who am i
root pts/1 2012-02-13 23:32 (:0.0)
32.history
33.alias
[root@localhost ~]# alias folder="cd /root/Desktop/folder"
[root@localhost ~]# folder
[root@localhost folder]#
[root@localhost folder]# unalias folder
[root@localhost folder]# cd ../..
[root@localhost ~]# folder
bash: folder: command not found
34.PS1 PS2
[root@localhost]PS1="[\u@\h\t]"
[root@localhost00:11:12]cal
35.*
[root@localhost16:12:09]rm /root/Desktop/new*
rm: remove regular file `/root/Desktop/new file'? y
rm: remove regular file `/root/Desktop/new file 1'? n
36.?
[root@localhost16:12:09]rm /root/Desktop/new*
rm: remove regular file `/root/Desktop/new file'? y
rm: remove regular file `/root/Desktop/new file 1'? n
37.[]
[root@localhost Desktop]# ls folder[1-4]
folder2:
folder3:
folder4:
38.find
[root@localhost ~]# find /root/Desktop/ -name "folder" -print
/root/Desktop/folder
/root/Desktop/folder/folder
[root@localhost ~]# find /root/Desktop/ -size +8 -print
/root/Desktop/file~
/root/Desktop/fcitx-3.6.3.tar.tar
/root/Desktop/file2.zip
/root/Desktop/file
[root@localhost ~]# find /root/Desktop/ -size -8 -print
/root/Desktop/folder/folder/new m,mmfile
/root/Desktop/folder/file2.gz
/root/Desktop/file2
/root/Desktop/file.tar.gz
/root/Desktop/file1
/root/Desktop/file1~
[root@localhost ~]# find /root/Desktop/ -name file* -size -8 -print
/root/Desktop/folder/file2.gz
/root/Desktop/file2
/root/Desktop/file.tar.gz
/root/Desktop/file1
/root/Desktop/file1~
39.cat
[root@localhost Desktop]# cat -en file2
1 hi$
2 i am ann$
3 who are you$
4 ???$
40.grep
[root@localhost Desktop]# grep -n "cat" file
86:[root@localhost Desktop]# cat file2
204:[root@localhost Desktop]# cat file1
340:39.cat
341:[root@localhost Desktop]# cat -en file2
[root@localhost Desktop]# grep -c "cat" file
4
[root@localhost Desktop]# ls|grep -v "hi" file2
i am ann
who are you
???
[root@localhost Desktop]#
[root@localhost Desktop]# grep -v "hi" file2
i am ann
who are you
???
41.comm
[root@localhost Desktop]# comm -12 file1 file2
a
[root@localhost Desktop]# comm -23 file1 file2
b
c
d
hi,pretty girl
[root@localhost Desktop]# comm -123 file1 file2
42.diff
[root@localhost Desktop]# diff file1 file2
2,5c2,4
< b
< c
< d
< hi,pretty girl
---
> hi
> who are you
> ???
43.wc
[root@localhost Desktop]# wc -lcw file2
4 6 21 file2
[root@localhost Desktop]# wc -lcw file1
5 6 23 file1
[root@localhost Desktop]# wc<<!
> k
> l
> l
> f
> d
> !
5 5 10
44.guandao
[root@localhost Desktop]# cat file1
hi
boys
nice to meet you
[root@localhost Desktop]# cat file1|grep 'n'|wc -l
1
45.whereis
[root@localhost ~]# whereis cd
cd: /usr/share/man/man1p/cd.1p.gz /usr/share/man/man1/cd.1.gz
[root@localhost ~]# whereis -b cd
cd:
[root@localhost ~]# whereis -m cd
cd: /usr/share/man/man1p/cd.1p.gz /usr/share/man/man1/cd.1.gz
[root@localhost ~]# whereis -s cd
cd:
[root@localhost ~]# whereis -u cd
cd: /usr/share/man/man1p/cd.1p.gz /usr/share/man/man1/cd.1.gz