linux 点空格文件 命令用法

[root@centos2 ~]# ls
anaconda-ks.cfg  bin  testt.sh
[root@centos2 ~]# . testt.sh
hello word
[root@centos2 ~]# ll -ah testt.sh
-rw-r--r-- 1 root root 31 Apr  6 01:18 testt.sh
[root@centos2 ~]#


[root@centos2 ~]# cat .bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi



  以往执行文件时都是用./file_name的形式,查阅了资料得知:

1、 如果我们要执行某个文件,但是此文件不可执行,此时我们要用chmod u+x file_name来使文件具有可执行权限

2、可是有时我们不想更改此文件的执行权限,但又想执行此文件,可以采用(点号--空格--文件名)的形式来执行一个脚本(只有root用户才可以这么做


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值