在一个命令中更改目录并执行文件 [英] Change directory and execute file in one command

查看:86
本文介绍了在一个命令中更改目录并执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想执行一个文件时,似乎总是必须先"cd"进入该文件的目录,然后再执行它,除非它因无法找到my-dataz类型错误而失败.

When I want to execute a file, it seems that I always have to first 'cd' into that file's directory before executing it, unless it fails on a can't-find-my-dataz type error.

如何绕过键入两个命令以仅执行一个程序?

How can I get around typing two commands to just execute a program?

示例:

cd /usr/local/bin/minecraft/
java -Xms512M -Xmx2048M -jar minecraft.jar

我如何将其分成一行,以便在Gnome3中创建自定义启动器时将其作为Exec = _ 行?

How can I make that into one line, so as I can put it as my Exec=_ line when creating a custom launcher in Gnome3?

推荐答案

cd /usr/local/bin/minecraft/ && java -Xms512M -Xmx2048M -jar minecraft.jar应该做到

这篇关于在一个命令中更改目录并执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆