欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

how to know whether a directory existing in my ubuntu

程序员文章站 2023-12-30 17:05:34
...

if you want to test a directory whether existing in your ubuntu computer

1:test -d /home
2:echo  $?
if the answer is 0,it means that this directory exists.
if other number,you can know that your computer doesn't have the directory

if you want to create a new directory, you can do like this

sudo mkdir /var/my_sql_back

if you want to see if you are the root user
you can use this command

echo $UID 
# if the result is 0, you are the superuser
# if not,you are not the superuser
#also you can do like this 
echo $USER
#it will tell you that who you are ,if the result is root 
#your computer are in superuser mode
#if not,you are now in the common mode



相关标签: some_new_tricks

上一篇:

下一篇: