ubuntu server基本操作

目前使用的是VMware,安装了ubuntu 12.04.3版本的server。

先进入,

ubuntu:~$ ifconfig得到IP地址。

目前本机上还安装了一个putty。putty.exe,输入ip,open.

login as: dream410
dream410@192.***.***.***’s password:
Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.8.0-29-generic x86_64)

* Documentation:  https://help.ubuntu.com/

System information as of Sun Dec  8 22:11:35 CST 2013

System load:  0.13              Processes:           82
Usage of /:   6.2% of 19.07GB   Users logged in:     1
Memory usage: 31%               IP address for eth0: 192.***.***.***
Swap usage:   0%

Graph this data and manage this system at https://landscape.canonical.com/

86 packages can be updated.
49 updates are security updates.

Last login: Sun Dec  8 22:09:23 2013
dream410@ubuntu-test:~$ vim
dream410@ubuntu-test:~$ sudo su
[sudo] password for dream410:

//获得管理员权限
root@ubuntu-test:/home/dream410# cd /var/www

//默认的web目录
root@ubuntu-test:/var/www# vi test.php
//进入
<?php
if($_POST['username']){
echo $_POST['username'].”, welcome.”;
}else{
?>
<form action=”" method=”post”>
<input name=”username” type=”text”>
<input type=”submit”>
</form>

<?php
}
~
~

“test.php” 12L, 188C                                          1,1           All

一些基础操作:

h:同一行中上一个字符

j:上一行

k:下一行

l:同一行中的下一个字符

i:进入insert模式

w:移动到下一个单词的首字母

W:移动到下一个空格的后面的那个字母(如果有连续的空格则移动到下一个不是空格的字母)

esc:退出insert模式

冒号:进入命令模式

保存并退出:     wq(enter)

不保存并退出:  q!(enter)

root@ubuntu-test:/var/www#

关于 chmod:

root@ubuntu-test:/var/www# chmod -x test.php
root@ubuntu-test:/var/www# ll
total 16
drwxr-xr-x  2 root root 4096 Dec  8 22:55 ./
drwxr-xr-x 13 root root 4096 Dec  8 21:55 ../
-rw-r–r–  1 root root  177 Dec  8 21:56 index.html
-rw-r–r–  1 root root  188 Dec  8 22:26 test.php
root@ubuntu-test:/var/www# chmod +x test.php
root@ubuntu-test:/var/www# ll
total 16
drwxr-xr-x  2 root root 4096 Dec  8 22:55 ./
drwxr-xr-x 13 root root 4096 Dec  8 21:55 ../
-rw-r–r–  1 root root  177 Dec  8 21:56 index.html
-rwxr-xr-x  1 root root  188 Dec  8 22:26 test.php*


/*

d(文件夹)    rwx (用户权限)   r-x(用户所在组权限)    r-x(访客权限)

chmod -x test.php

这样修改会根据访问者权限的不同而不同

同理还有chmod +x test.php

此外 chmod 777 test.php

这样则根据2进制使得所有制1即:
-    rwx   rwx    rwx(7,7,7)

同理 chmod 124 test.php
-    –x    -w-     r– (1,2,4)

*/

PS:对于安装一个东西时,一下输出的太多,则可以用:|more实现分屏。

按空格键则看下一面代码。

ctrl+C强制停止


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值