banner



Why Does Terminal Show Last Login: Thu Jan 17 14:37:32 on Ttys00 Updated FREE

Why Does Terminal Show Last Login: Thu Jan 17 14:37:32 on Ttys00

数据科学家工具箱 (Data Scientist'south Toolbox)

Accept you ever bought a mattress?

你买过床垫吗?

Allow me tell y'all nearly my experience with the notorious mattress salesmen.

让我告诉您我在臭名昭著的床垫销售员那里的经历。

Salesmen would talk their way into making y'all buy something you lot don't actually need or a more than expensive version of something you practise demand.

推销员会说服他们让您购买真正不需要的东西,或者购买确实需要的东西的较贵版本。

Personally, I like to shop in peace. That ways I would adopt non having a salesman follow me while I scan. Still, information technology is nearly incommunicable to detect a mattress store without salesmen.

就个人而言,我喜欢安心购物。 这意味着在浏览时,我宁愿不要推销员跟着我。 但是,几乎不可能找到没有推销员的床垫商店。

One time y'all heard one of the sales pitches, you lot realise that all of them are exactly the aforementioned. Virtually like the script of a picture that you watch over and over once again.

听到其中一种推销音后,您就会意识到它们都是完全相同的。 就像您一次又一次观看电影的剧本一样。

"Our beds are good for your spine."

"我们的床对您的脊椎有益。"

"Think about the medical bill you would have subsequently on in life if you sleep on bad mattress."

"想想如果您睡在不好的床垫上,以后会遇到的医疗费用。"

"What'southward the point of having coin if you could not enjoy it?"

"如果您不能享受金钱,那有什么意义呢?"

At one signal though, one of the pitches stood out.

然而,在某一时刻,其中一个球场显得突出。

"How much time do you spend everyday sitting in your motorcar? 2 hours? And how much does your machine cost? Similarly, how much fourth dimension do you spend everyday on the bed?"

"您每天花多少时间坐在车上? 两个小时? 您的汽车要花多少钱? 同样,您每天在床上花费多少时间?"

Then he showcased a $5,000 mattress.

然后,他展示了一张价值5,000美元的床垫。

I'm not here to tell you lot to buy a $5,000 mattress, though.

不过,我并不是要告诉您购买5,000美元的床垫。

What I learned from that sales pitch is you should pay more attention to the things you really utilise in your daily life.

我从销售推销中学到的是,您应该更加注意自己在日常生活中实际使用的东西。

If you work every bit either a software engineer, automobile learning engineer, or data scientist, there is a high take chances that:

如果您是软件工程师,机器学习工程师或数据科学家,则很有可能:

  1. You lot use MacOS 您使用MacOS
  2. You spend most of your fourth dimension using the terminal 您将大部分时间都花在使用终端上

I believe that improving the whole concluding experience, something yous employ everyday, is a good investment that will be worth it in the long run.

我相信,改善日常使用的整个终端体验是一项不错的投资,从长远来看,这是值得的。

That beingness said, are yous still using the default MacOS terminal?

话虽如此,您仍在使用默认的MacOS终端吗?

终点站 (The Terminal)

There are a lot of popular final replacements out at that place. I have tried some of them, and here's what I would recommend to my friends.

那里有很多受欢迎的终端机替代品。 我已经尝试过其中的一些,这就是我向朋友推荐的内容。

iTerm2 (iTerm2)

By far the nearly powerful replacement for MacOS terminal.

迄今为止,MacOS终端的最强大替代品。

Image for post

iTerm2 (Paradigm by Author)
iTerm2(作者提供的图片)

On a glance, it looks very similar to the default terminal. However, it comes with a lot of features that are non present in the Terminal and other last replacements.

乍一看,它看起来与默认终端非常相似。 但是,它具有许多功能,这些功能在终端机和其他终端机替代品中不存在。

In my opinion, the one feature that stood out the most is Profile.

我认为,最引人注目的一项功能是Profile。

Existence a developer, most of the fourth dimension you will be accessing remote servers to work on them. Each of the server volition have unique IP address, and you don't desire to think the IP for each i.

作为开发人员,大多数时候您将访问远程服务器以在其上工作。 每个服务器都将具有唯一的IP地址,并且您不想记住每个服务器的IP。

You could create an entry in the ssh config file ~/.ssh/config that looks like this:

您可以在ssh配置文件~/.ssh/config中创建一个条目,如下所示:

          Host work_server
HostName <IP address>
User <username>

Then, y'all could only type ssh work_server instead of manually typing the IP address over and over again.

然后,您只需键入ssh work_server而不必ssh work_server手动键入IP地址。

In iTerm2, you can create a Contour for every auto instead. Here's the setup for a simple profile to ssh into a server.

在iTerm2中,可以为每台计算机创建一个Profile。 这是一个简单的配置文件ssh进入服务器的设置。

Image for post

iTerm2 Profile Setting (Prototype by Author)
iTerm2配置文件设置(作者提供的图像)

After that, you could simply select the contour from the drop down menu to open a new terminal tab where you are already connected through ssh into that machine.

之后,您可以简单地从下拉菜单中选择配置文件,以打开一个新的终端选项卡,在该选项卡中您已经通过ssh连接到该计算机。

This is just one of the use cases of how I employ Profiles, at that place are a lot of other utilise cases for this characteristic.

这只是我使用个人档案的用例之一,此功能还有很多其他用例。

Do you utilize different conda environment for each projection? Create a profile to straight open up the project'due south working directory and run the command conda actuate surround to salvage your time.

每个项目是否使用不同的conda环境? 创建一个配置文件以直接打开项目的工作目录,并运行conda activate environment命令以节省您的时间。

I thing to note though, if yous're non using the Profile to ssh, you need to alter the Command to Login Shell instead, and then add the control at the Send text at kickoff field. You could also run multiple commands by separating them with ;

不过要注意的一件事是,如果您不使用Profile来ssh,则需要将Command更改为Login Beat,然后Ship text at start字段中添加命令。 您也可以使用;将它们分开来运行多个命令;

For the default starting directory, y'all could put cd /path/to/workdir inside the Send text at get-go or specify information technology in the Directory section.

对于默认的起始目录,可以将cd /path/to/workdir放在" Send text at start或在" Directory部分中指定它。

Desire to make your flow fifty-fifty faster? Specify a shortcut fundamental to open a Profile using hotkeys, such as ⌘^A.

是否想让您的流程更快? 指定快捷键以使用诸如^ A之类的热键打开配置文件。

(Hyper)

Do you lot like beautiful last straight out-of-the-box? This might be the i for you.

您是否喜欢开箱即用的漂亮终端? 这可能是您的最佳选择。

Image for post

Hyper (Image past Author)
超级(作者提供的图片)

Easily the best looking terminal replacement for MacOS, Hyper is built using HTML, CSS, and JS.

Hyper是使用HTML,CSS和JS构建的,很容易成为MacOS的最佳外观终端替代品。

Ane notable feature that differentiates Hyper from the other terminal is its plugins. It has tons of custom plugins fabricated only for Hyper. Here's a repository called awesome-hyper that contains curated Hyper plugins complete with a curt description of them.

插件是Hyper与其他终端区别的一个显着特征。 它有大量专门为Hyper设计的自定义插件。 这是一个名为awesome-hyper的存储库 包含精选的Hyper插件,并附有简短描述。

Yous could hands install plugins and even change themes or color schemes by editing ~/.hyper.js configuration file.

您可以通过编辑~/.hyper.js配置文件轻松安装插件,甚至更改主题或配色方案。

In that location are a lot of interesting plugins, such equally hypergoogle which enables you to search google straight through Hyper. Information technology will open a new browser window though, then you don't have to worry nearly navigating a webpage inside the terminal. hyper-spotify will bear witness currently playing song on Spotify at the superlative or bottom of your terminal and lets you control it, perfect for developers who don't want to stay in the terminal at all fourth dimension.

有很多有趣的插件,例如hypergoogle ,它使您可以直接通过Hyper搜索google。 但是,它将打开一个新的浏览器窗口,因此您不必担心在终端机内部浏览网页。 hyper-spotify会在终端的顶部或底部在Spotify上显示当前正在播放的歌曲,并让您对其进行控制,非常适合不想一直留在终端中的开发人员。

Unfortunately, Hyper does not have the Profiles characteristic like iTerm2. Information technology's a perfectly good and capable concluding, but the convenience of Profiles kept pulling me back towards iTerm2.

不幸的是,Hyper没有像iTerm2这样的配置文件功能。 这是一个非常优秀且功能强大的终端,但是Profiles的便利性使我一直回到iTerm2。

荣誉奖: 敏捷 ( Honorable mention: Alacritty )

Alacritty takes pride in being "the fastest terminal emulator in existence." The secret? They apply GPU to power up the terminal, which effect in very fast rendering compared to other terminal.

Alacritty以成为"现有最快的终端模拟器"而感到自豪。 秘密? 他们使用GPU为终端供电,与其他终端相比,渲染速度非常快。

The downside? It consumes a lot of power.

不足之处? 它消耗很多功率。

If you lot are ever working from a desk and your car is always connected with the charging cable, then it might not seem that bad. On the other hand, if you lot sometimes work from the comfort of your sofa, information technology would become uncomfortable quite fast once the bottom of your laptop becomes hot and the battery needs to be recharged much more often.

如果您始终在办公桌旁工作,并且您的机器始终与充电电缆相连,那么看起来似乎还不错。 另一方面,如果您有时在舒适的沙发上工作,则一旦笔记本电脑的底部变热并且需要更频繁地为电池充电,它就会变得非常不舒服。

On top of that, Alacritty also does non support Profiles similar iTerm2, so it'due south not for me.

最重要的是,Alacritty还不支持像iTerm2这样的配置文件,因此不适合我。

It depends on your main focus though. If y'all are all virtually that speed and battery drain is non a problem for yous, then by all ways, this is the ane for you.

这取决于您的主要重点。 如果您只追求那种速度,而电池消耗对您来说不是问题,那么从某种意义上说,这就是您的选择。

自定义终端 (Customising Your Terminal)

Now that you take called your final, it's fourth dimension to start customising them.

现在您已经选择了终端,是时候开始自定义它们了。

No affair which terminal you picked, the customisation should work for any of them, even if you make up one's mind to utilise entirely different terminal than the ones listed to a higher place.

无论选择哪个终端,即使您决定使用与上述终端完全不同的终端,自定义设置也应适用于其中任何一个终端。

Here's a quick script that I use to install Homebrew, zsh, oh-my-zsh, and powerlevel10k.

这是我用来安装Homebrew,zsh,oh-my-zsh和powerlevel10k的快速脚本。

Copying the commands and executing them line-by-line is okay, since there are only a few lines.

可以复制命令并逐行执行它们,因为只有几行。

Y'all could too re-create and salvage the content to a file chosen terminal_upgrade.sh and then open the terminal, cd into the directory, and give permission to execute by using this control.

您还可以将内容复制并保存到名为terminal_upgrade.sh的文件中,然后打开终端,进入目录cd ,并使用此命令授予执行权限。

          chmod +x terminal_upgrade.sh        

After that, execute this command to run the script.

之后,执行此命令以运行脚本。

          ./terminal_upgrade.sh        

Practice note that information technology could not automatically install the powerlevel10k theme though, please read the Powerlevel10k section for further instructions.

请注意,尽管它不能自动安装powerlevel10k主题,请阅读Powerlevel10k部分以获取更多说明。

I would go into more details for every item in the sections beneath.

我将在以下各节中为每一项提供更多详细信息。

家酿 (Homebrew)

          /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"        

Homebrew is essential for whatsoever programmer that uses MacOS. It is a package managing director that allows you lot to install a lot of things directly from the terminal.

对于使用MacOS的任何开发人员来说,自制软件都是必不可少的。 它是一个软件包管理器,它使您可以直接从终端安装很多东西。

Near any mainstream package is installable through Homebrew, and you could install even more stuffs by installing cask for Homebrew.

几乎所有主流软件包都可以通过Homebrew安装,并且您可以通过为Homebrew安装cask来安装更多东西。

          mash install cask        

Even you could install iTerm2 through Homebrew'southward cask.

甚至您也可以通过Homebrew的容器安装iTerm2。

          brew cask install iterm2        

In short, this is a must accept package manager, simply similar apt in Linux.

简而言之,这是一个必须具有的软件包管理器,就像Linux中的apt一样。

sh (zsh)

          brew install zsh zsh-completions        

If iTerm2 is the replacement for Terminal, zsh is the replacement for bash.

如果iTerm2替代Terminal,则zsh替代bash。

Short for Z trounce, information technology is built on height of sh (Bourne Shell), only similar its analogue bash (Bourne Again Beat).

Z shell的缩写,它建立在sh(Bourne Beat out)的顶部,就像它的对应bash(Bourne Again Beat out)一样。

Information technology has small improvements such as non needing to blazon cd to navigate through the documents.

它有一些小的改进,例如不需要键入cd即可浏览文档。

I rarely apply the feature since non all concluding you volition work on is using zsh, then it's a good practice to utilize cd even though you lot know zsh doesn't need that.

我很少使用该功能,因为并非您将要使用的所有终端都使用zsh,因此即使您知道zsh不需要cd ,这也是使用cd的一种好习惯。

Yet, the primary reason you should apply zsh is because of oh-my-zsh.

但是,应使用zsh的主要原因是因为oh-my-zsh。

我的天啊 (oh-my-zsh)

          sh -c "$(ringlet -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"        

Oh-my-zsh is a framework for zsh that makes information technology much easier to install and manage plugins for zsh.

Oh-my-zsh是zsh的框架,可以更轻松地安装和管理zsh插件。

Just like the plugins for Hyper, oh-my-zsh's plugins are divers inside a file. In this case, information technology's the ~/.zshrc file.

就像Hyper的插件一样,oh-my-zsh的插件在文件中定义。 在这种情况下,它是~/.zshrc文件。

1 thing to note, this is a completely dissimilar plugin manager than the one Hyper has. It's possible to use both Hyper and oh-my-zsh, just continue in heed plugins for Hyper is defined in ~/.Hyper.js and plugins for oh-my-zsh is inside ~/.zshrc

需要注意的是,这是与Hyper完全不同的插件管理器。 它可以同时使用超和OH-MY-zsh的,只要记住插件超在定义~/.Hyper.js和插件哦,我的-的zsh里面~/.zshrc

Here'south a list of notable plugins for oh-my-zsh, and also list of themes for oh-my-zsh.

这是oh-my-zsh的著名插件的列表,以及oh-my-zsh 的主题列表 。

To install the plugins you desire, simply put it inside the plugins=() line inside the oh-my-zsh configuration file.

要安装所需的插件,只需将其放在oh-my-zsh配置文件内的plugins=()行中即可。

For themes, you lot could specify which theme you want to utilize in the line specifying ZSH_THEME=... line, which brings the states to our terminal betoken.

对于主题,您可以在指定ZSH_THEME=...行的行中指定要使用的主题,这将我们带到最后一点。

功率水平10k (Powerlevel10k)

          cd $ZSH_CUSTOM/themesgit clone --depth=one https://github.com/romkatv/powerlevel10k.git        

Powerlevel10k is the much faster version of its predecessor (Powerlevel9k) and packed with more than features.

Powerlevel10k是其前身(Powerlevel9k)的更快版本,并具有更多功能。

In short, it's my go-to theme for the terminal.

简而言之,这是终端的我的首选主题。

Afterward running the script to clone Powerlevel10k within the $ZSH_CUSTOM/themes directory, you need to edit the line inside ~/.zshrc that defines the ZSH_THEME to the following.

运行脚本以在$ZSH_CUSTOM/themes目录中克隆$ZSH_CUSTOM/themes ,您需要在~/.zshrc ZSH_THEME编辑以下定义ZSH_THEME的行。

          ZSH_THEME=powerlevel10k/powerlevel10k        

Reload the zsh for the change to take effect by executing

通过执行以下命令重新加载zsh以使更改生效

          source ~/.zshrc        

It should beginning the Powerlevel10k configuration wizard. If it doesn't run p10k configure to manually start the wizard and follow the on-screen instructions to choose how you want the terminal to look similar.

它应该启动Powerlevel10k配置向导。 如果未运行, p10k configure为手动启动向导,然后按照屏幕上的说明选择所需的终端外观。

If you take a lot of plugins in your oh-my-zsh, it may take a while to load the plugins when you first open the concluding. Powerlevel10k has the instant prompt feature to let you kickoff using the terminal while the plugins are loaded in the background.

如果您的oh-my-zsh中有很多插件,那么在您第一次打开终端时可能需要一段时间才能加载这些插件。 Powerlevel10k具有即时提示功能,可让您在将插件加载到后台的同时开始使用终端。

恭喜啦 (Congratulations)

You are now officially a member of the Enhanced MacOS Last Order. Gone are the days where you lot stare at mediocre last sessions.

您现已正式成为增强型MacOS终端俱乐部的成员。 盯着普通的终端会议的日子已经一去不复返了。

Here's what your terminal should look like if you did install everything listed above.

如果您确实安装了上面列出的所有内容,那么您的终端应该是这样的。

Image for post

Final Consequence (Image past Author)
最终结果(作者提供的图片)

It might await a chip different if you choose different customisation option inside Powerlevel10k, but in general it's similar. Personally, I similar the fashion it shows the agile Conda environment and as well the active branch of the repository.

如果您在Powerlevel10k中选择不同的自定义选项,则可能看起来有些不同,但通常情况是相似的。 就个人而言,我喜欢它显示活动的Conda环境以及存储库的活动分支的方式。

Having a beautiful concluding alone volition not make you a amend programmer, but it volition surely help you on your way to beingness one. Here'southward another article of mine that could help you lot principal the terminal.

仅仅拥有一个漂亮的终端并不能使您成为一名更好的程序员,但是它一定会帮助您成为一名程序员。 这是我的另一篇文章,可以帮助您掌握终端。

It shows how you could easily chain programs inside the concluding, create your own custom commands, and some useful commands that you may or may not have used yet.

它显示了如何轻松地将程序链接到终端中,如何创建自己的自定义命令以及一些您可能已经使用或尚未使用的有用命令。

One final matter to note, there is no wrong way to customise your terminal. It's your terminal, non anyone else'due south.

最后要注意的一点是,自定义终端没有错误的方法。 这是您的终端,而不是其他任何人的终端。

Everything I listed above is what I always do to my own terminal since I started my career every bit a information scientist. Your needs may be different than mine and that is perfectly fine.

自从我作为数据科学家开始职业生涯以来,上面列出的所有内容都是我一直在自己的终端上所做的事情。 您的需求可能与我的有所不同,这很好。

It doesn't matter how yous customise your terminal, but I hope it makes you aware of how awful the default MacOS Terminal is.

定制终端的方式无关紧要,但是我希望它使您知道默认MacOS终端的糟糕程度。

You know what Robin Sharma said, "Own Your Terminal. Drag Your Life" or was it something else?

您知道Robin Sharma所说的话: "拥有您的终端机。 提升生活"还是其他?

Why Does Terminal Show Last Login: Thu Jan 17 14:37:32 on Ttys00

DOWNLOAD HERE

Source: https://www.csdn.net/tags/OtDaYg2sNTU4OTgtYmxvZwO0O0OO0O0O.html

Posted by: worthingtonpeturber.blogspot.com

0 Response to "Why Does Terminal Show Last Login: Thu Jan 17 14:37:32 on Ttys00 Updated FREE"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel