![](/img/trans.png)
[英]How can I randomize the lines in a file using standard tools on Red Hat Linux?
[英]How can I shorten a path in red hat linux?
因此,我在一个路径很长的目录中有一堆文件用于测试,因此说/home/grammin/testFiles/program1/important/.
有10个文件/home/grammin/testFiles/program1/important/.
我想做的是在bashrc中有东西吗? 也许就像fileDir = /home/grammin/testFiles/program1/important/
,然后每当我想在命令行上访问特定文件时,我要做的就是键入ls fileDir/FILE1
类的东西。 谢谢您的帮助。
您可以通过ln
命令来实现。 与此类似
ln -s /home/grammin/testFiles/program1/important/ fileDir
我认为运行这个就足够了
只需设置一个变量: fileDir=/home/grammin/testFiles/program1/important
。
现在ls $fileDir/FILE1
将具有所需的效果。
您应该创建指向所需路径的符号链接,并在使用终端时将链接路径用作“键入快捷方式”。
例如,如果您具有/this/is/a/very/long/filesystem/path
,则可以使用ln -s /this/is/a/very/long/filesystem/path pth
创建链接,然后使用ls pth/FILE1
在您的.bashrc文件中,添加Importantdir = / home / grammin / testFiles / program1 / important /
然后将该变量与美元一起使用,例如ls $ importantdir / FILE1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.