小小搜集了Linux的常用的命令的集合。

pwd 命令

使用pwd命令可以立刻得知当前所在的工作目录的绝对路径

[[email protected]]~> pwd                                                                                                                                                                                                              <br></br>/home/www        

cd 命令


改变当前目录到目录名,若目录名称省去,将会直接变换到使用者的用户的主目录,也就是刚刚登陆的时候的主目录。

                                                                                                                                                                                                                               <br></br>[[email protected]]~> pwd                                                                                                                                                                                                              <br></br>/home/www                                                                                                                                                                                                                      <br></br>[[email protected]]~> cd ..                                                                                                                                                                                                            <br></br>[[email protected]]/home> pwd                                                                                                                                                                                                          <br></br>/home                                                                                                                                                                                                                          <br></br><br></br>

ls 命令

显示当前目录所包含的文件和子目录。

[[email protected]]/home> ls                                                                                                                                                                                                           <br></br>www             

ls -l 命令

以完整的样式显示当前目录下的文件和目录

[[email protected]]/home> ls -l                                                                                                                                                                                                        <br></br>drwxr-xr-x   1 root  wheel    766 Nov 10  2007 www  

mkdir 命令

使用mkdir命令,可以新建子目录

~ $ mkdir ./ming                                                                <br></br>~ $ ls                                                                          <br></br>ming                                                                            <br></br><br></br>

rmdir 命令

删除空的子目录

~ $ ls                                                                          <br></br>ming                                                                            <br></br>~ $ rmdir ./ming/                                                               <br></br>~ $ ls                                                                          <br></br><br></br>

cp 命令

使用cp命令把一个源文件备份到另外一个目标文件

~ $ touch ./ming                                                                <br></br>~ $ touch ./ming1                                                               <br></br>~ $ ls                                                                          <br></br>ming   ming1                                                                    <br></br>~ $ cp ./ming ./ming2                                                           <br></br>~ $ ls                                                                          <br></br>ming   ming1  ming2                                                             <br></br><br></br>

rm 命令

使用rm命令删除文件

~ $ ls                                                                          <br></br>ming   ming1  ming2                                                             <br></br>~ $                                                                             <br></br>~ $ rm ./ming2                                                                  <br></br>~ $ ls                                                                          <br></br>ming   ming1                                                                    <br></br><br></br>

find 命令

使用find命令可以查看文件或者目录

在根目录下查询文件名为login的文件,并把查询的结果打印出来。

~ $ find / -name login -print                                                   <br></br>find: /proc/tty/driver: Permission denied                                       <br></br>find: /proc/1/task/1/fd: Permission denied                                      <br></br>find: /proc/1/task/1/fdinfo: Permission denied                                  <br></br>find: /proc/1/task/1/ns: Permission denied  

rar 命令 备份

使用tar命令进行备份

~ $ tar -cvf ming.tar ./ming                                                    <br></br>./ming                                                                          <br></br>~ $ ls                                                                          <br></br>ming      ming.tar  ming1                                                       <br></br><br></br>

gzip 压缩

使用gzip命令可以实现对文件的压缩

~ $ gzip ./ming.tar                                                             <br></br>~ $ ls                                                                          <br></br>ming         ming.tar.gz  ming1                                                 <br></br><br></br>

gunzip 解压缩

使用gunzip命令可以实现对文件的解压缩

~ $ gunzip ./ming.tar.gz                                                        <br></br>~ $ ls                                                                          <br></br>ming      ming.tar  ming1                                                       <br></br><br></br>

ps 命令

使用ps命令显示进程

~ $ ps -e                                                                       <br></br>PID   USER     TIME   COMMAND                                                   <br></br>    1 root       0:00 init                                                      <br></br>    2 root       0:00 [kthreadd]                                                <br></br>    3 root       0:00 [ksoftirqd/0]                                             <br></br>    4 root       0:00 [kworker/0:0]                                             <br></br>    5 root       0:00 [kworker/0:0H]                                            <br></br>    6 root       0:00 [kworker/u2:0]                                            <br></br>    7 root       0:00 [kdevtmpfs]                                               <br></br>    8 root       0:00 [writeback]                                               <br></br>    9 root       0:00 [bioset]                                                  <br></br>   10 root       0:00 [kblockd]                                                 <br></br>   11 root       0:00 [ata_sff]                                                 <br></br>   12 root       0:00 [rpciod]                                                  <br></br>   13 root       0:00 [kworker/0:1]                                             <br></br>   14 root       0:00 [kswapd0]                                                 <br></br>   15 root       0:00 [fsnotify_mark]                                           <br></br>   16 root       0:00 [nfsiod]                                                  <br></br>   17 root       0:00 [kworker/u2:1]      

kill命令

使用kill命令可以把进程杀死

kill -9 3872

ping 命令

使用ping命令可以实现主机与目标主机的网络连通性

~ $ ping www.baidu.com                                                          <br></br>PING www.baidu.com (104.193.88.123): 56 data bytes                              <br></br>64 bytes from 104.193.88.123: seq=0 ttl=56 time=279.181 ms                      <br></br>64 bytes from 104.193.88.123: seq=1 ttl=56 time=283.378 ms                      <br></br>^C                                                                              <br></br>--- www.baidu.com ping statistics ---                                           <br></br>2 packets transmitted, 2 packets received, 0% packet loss                       <br></br>round-trip min/avg/max = 279.181/281.279/283.378 ms                             <br></br><br></br>

ifconfig 命令

使用该命令可以显示其网卡的信息

ifconfig

 title=

小明菜市场

标签: Linux, 命令, 常用命令, root, www, ls, 程序员, ming

相关文章推荐

添加新评论,含*的栏目为必填