ssh框架配置文件流程_通过配置文件和安排增强您的工作流程

 2023-09-06 阅读 16 评论 0

摘要:ssh框架配置文件流程by Marcus Wood 由马库斯伍德(Marcus Wood) 通过配置文件和安排增强您的工作流程 (Supercharge your workflow with profiles and arrangements) If you’ve ever had to manage multiple projects, keeping up with the command line can be cumbersome.

ssh框架配置文件流程

by Marcus Wood

由马库斯·伍德(Marcus Wood)

通过配置文件和安排增强您的工作流程 (Supercharge your workflow with profiles and arrangements)

If you’ve ever had to manage multiple projects, keeping up with the command line can be cumbersome. Here are a couple of hot tips on how juggle multiple projects that will save you a ton of time.

如果您曾经必须管理多个项目,那么跟上命令行可能会很麻烦。 以下是一些热门技巧,说明如何处理多个项目可以为您节省大量时间。

If you’re using the regular Mac Terminal, I highly recommend switching over to iTerm2 (it’s just better). More on why in a bit.

如果您使用的是普通Mac终端,我强烈建议您切换到iTerm2 (这样更好)。 进一步说明原因。

SSH别名 (SSH Aliases)

Sometimes, you need to SSH into a server somewhere. Sometimes you have twenty different servers you’d like to SSH into. Remembering where they live and what they’re called can be a pain.

有时,您需要在某处通过SSH进入服务器。 有时您想使用SSH连接到二十台不同的服务器。 记住他们的住处和名字可能会很痛苦。

To save time, create aliases for each server in under a minute. Here’s how:

为了节省时间,请在一分钟内为每个服务器创建别名。 这是如何做:

// Open a terminal windownano ~/.ssh/config
// Fill in the following to create an aliasHost <Name you want to assign>  Hostname <Where you want to ssh>  User <User you want to login as>  IdentityFile ~/.ssh/<pem file you want to use>
//Exit and save the filectrl + xyenter
// Now instead of doing this to connectssh -i "<pem file>" <user>@<hostname>
// You can do thisssh name-you-assigned

iTerm2配置文件和安排 (iTerm2 Profiles and Arrangements)

Profiles are great and have changed my daily workflow. Sometimes your terminal looks like this:

个人资料很棒,并且改变了我的日常工作流程。 有时您的终端看起来像这样:

The problem is, you don’t know which window you want to click. You also don’t want to close out windows, because then you’ll have to open a new window, navigate back to the correct directory, and remember the copy pasta to make it go.

问题是,您不知道要单击哪个窗口。 您也不想关闭窗口,因为那样一来,您就必须打开一个新窗口,导航回到正确的目录,并记住复制意大利面的方法。

With profiles and window arrangements, you don’t have to worry about any of that.

使用配置文件和窗口排列,您不必担心任何这些。

There’s a quick video walk through below if you get lost on any of these steps.

如果您在以下任何一个步骤中迷失了方向,下面都会快速浏览视频。

A profile enables you to open a new command line window in a certain directory and run commands automatically. Let’s make one!

配置文件使您可以在特定目录中打开新的命令行窗口并自动运行命令。 让我们做一个!

First, close all open command line windows in iTerm, and start with a new command line window. Next, you’ll want to navigate to “Profiles” in the Menubar and click “Open Profiles…”

首先,关闭iTerm中所有打开的命令行窗口,然后从一个新的命令行窗口开始。 接下来,您将要导航至菜单栏中的“配置文件”,然后单击“打开配置文件...”

Now click “Edit Profiles…” which should bring you here:

现在,单击“编辑配置文件...”,它将带您到这里:

Click the + sign at the bottom left side to create a new profile. Make sure to give it a name and update the directory to be the the root of your project.

单击左下角的+号以创建新的配置文件。 确保为其命名,并将目录更新为项目的根目录。

If you want to run commands when this profile is opened, add them in the “Send text at start:” field. One of my favorite recipes is to open up the project in my code editor and build it for development.

如果要在打开此配置文件时运行命令,请将其添加到“在开始时发送文本:”字段中。 我最喜欢的食谱之一是在我的代码编辑器中打开该项目,并为开发而构建。

// Separate commands with a semi-colonatom .; preact watch

Exiting out of the window will save your changes (there’s no button to do this).

退出窗口将保存您的更改(没有按钮可以执行此操作)。

Next up, we need to test it out. Click on “Profiles” in the Menubar and select the profile you made to make sure it works. If you run into any issues, make sure your directory path is correct and that your commands are separated correctly.

接下来,我们需要对其进行测试。 点击菜单栏中的“个人资料”,然后选择您创建的个人资料以确保其有效。 如果遇到任何问题,请确保目录路径正确并且命令正确分隔。

Once all that works, it’s time to create a window arrangement to easily launch the newly made profile. Make sure you don’t have any lingering terminal windows open when you do this step or they’ll be saved as part of the arrangement.

一旦一切正常,是时候创建一个窗口布置以轻松启动新创建的配置文件了。 执行此步骤时,请确保没有打开任何残留的终端窗口,否则它们将被保存为安排的一部分。

In a new terminal window, click on the profile you just made. If it opens in a new tab make sure to close the “Default” tab. Navigate to the “Window” tab in the Menubar and select “Save Window Arrangement.” Give it a name and click ok. You’re good to go!

在新的终端窗口中,单击您刚创建的配置文件。 如果在新标签页中打开,请确保关闭“默认”标签。 导航至菜单栏中的“窗口”标签,然后选择“保存窗口排列”。 给它起一个名字,然后单击“确定”。 你很好!

Now all of your terminal windows will be named. They’ll automatically remember the commands you need to start each project.

现在,您所有的终端窗口都将被命名。 他们会自动记住启动每个项目所需的命令。

包装东西 (Wrapping Things Up)

After the first time you do so, you’ll be able to create new profiles and arrangements with ease. You can also combine multiple profiles into an arrangement, use tabbed terminal windows to run multiple parts of a project, and much more.

第一次这样做后,您将可以轻松创建新的配置文件和安排。 您还可以将多个配置文件组合到一个排列中,使用带选项卡的终端窗口来运行项目的多个部分,等等。

Was this helpful? If so, please clap on the story and let me know what else you’d like to know about my development process or tips on mastering the command line.

这个有帮助吗? 如果是这样,请拍一下故事,让我知道您还想了解我的开发过程或掌握命令行的技巧。

My name is Marcus Wood. I am the founder of Caldera, a full-service digital agency focusing on web applications.

我叫马库斯·伍德。 我是Caldera(一家专注于Web应用程序的全方位服务的数字代理)的创始人。

翻译自: https://www.freecodecamp.org/news/supercharge-your-workflow-with-profiles-and-arrangements-99099da313b5/

ssh框架配置文件流程

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/7707.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息