linux 小问题

来源:百度知道 编辑:UC知道 时间:2024/06/05 15:06:30
我在 一个固定的目录下有些自己的指令, 比如adb命令, 但是只能在这个文件夹下才可以用,
bash: adb: command not found
怎么能弄 的象shell中的命令一样, 随时随地可以用呢。
有人说可以修改 .profile文件的path,可是怎么改呢?
~/home/suojunqi/Android/sdk/tools/
是我 的adb命令路径。
1 # ~/.profile: executed by the command interpreter for login shells.
2 # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
3 # exists.
4 # see /usr/share/doc/bash/examples/startup-files for examples.
5 # the files are located in the bash-doc package.
6
7 # the default umask is set in /etc/profile
8 #umask 022
9
10 # if running bash
11 if [ -n "$BASH_VERSION" ]; then
12 # include .bashrc if it exists
13 if [ -f ~/.bashrc ]; then
14 . ~/.bashrc
15 fi
16 fi
17
18 # set PATH so it includes user's private bin if it exists
19 if [ -d ~/bin ] ; then
20 PATH=~/bin:"${PATH}":~/home/suojunqi/And

我不知道你用的什么发行版,但是给你个方法,就是写一个脚本在bin里

脚本内容指向到启动你指定的文件

之后这个就可以变为全局命令了

例如我的

#! /bin/bash
cd /root/linuxqq_preview1.0_2_i386
./qq & #./QQ 脚本运行方式 & 表示将作业放到后台

有些命令要root才行的