个人工具

“用户讨论:Jinzd”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
sudo
sudo
第16行: 第16行:
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
| width="200" | Show Minor Tick Marks
+
|-
| Specifies the minor tick marks will be shown or not.
+
| -A, --askpass
 +
|  使用一个辅助程序以提示密码。
 +
|-
 +
|
 +
|
 +
|}
  
Data  type: Boolean
 
  
Default: false, minor tick mark won't be shown.
 
|}
 
  
: -A, --askpass 使用一个辅助程序以提示密码。
 
 
: -b, --background 在后台运行命令。
 
: -b, --background 在后台运行命令。
 
: -C, --close-from=num 关闭所有大于等于num的文件描述。
 
: -C, --close-from=num 关闭所有大于等于num的文件描述。

2016年5月11日 (三) 15:36的版本

sudo

sudo

以其他用户身份执行一个命令.

用法:

sudo -h | -K | -V
sudo -v [-Akns] [-g group] [-h host] [-p prompt] [-u user]
sudo -l [-Akns] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [p prompt] [-u user] [VAR=value] [-i|-s] [<command>]
sudo -e [-Akns] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...

Options:

-A, --askpass 使用一个辅助程序以提示密码。


-b, --background 在后台运行命令。
-C, --close-from=num 关闭所有大于等于num的文件描述。
-E, --preserve-env
-e, --edit
-g, --group=group
-H, --set-home
-h, --help
-h, --host=host
-i, --login
-K, --remove-timestamp
-k, --reset-timestamp
-l, --list
-n, -- non-interactive
-P, --preserve-groups
-P, --prompt=prompt
-r, --role=role
-S, --stdin
-s, --shell
-t, --type=type
-U, --other-user=user
-u, --user=user
-V, --version
-v, --validate
--

PostgreSQL

For newest Ubuntu 16.04 postgresql is ready to install:

jinzd@ubuntu:~S sudo apt install postgresql-9.5

Get postgresql ready to use, set password is the first step:

jinzd@ubuntu:~S sudo -u postgres psql template1

template1=# \password postgres;

or

jinzd@ubuntu:~S sudo -u postgres psql postgres

postgres=# \password postgres;

Create database:

jinzd@ubuntu:~S sudo -u postgres created JUniverse

Create user:

jinzd@ubuntu:~S sudo -u postgres createuser