当前位置: 首页 > 编程日记 > 正文

终端软件升级功能开发_5个很棒的终端技巧可帮助您升级为开发人员

终端软件升级功能开发

There are plenty of beginner tutorials around that help you learn command line basics, such as cd, ls, pwd and so on...but what about that fancy magic you've seen more experienced developers use?

周围有很多初学者教程可以帮助您学习命令行基础知识,例如cdlspwd等。但是,您已经看到更多经验丰富的开发人员使用的那种奇特的魔术怎么办?

Here are my five favourite terminal commands and utilities (in no particular order), to help you feel like the wizard you aspire to be! This is based on Ubuntu, but should be similar across other platforms (with maybe a little Googling).

这是我最喜欢的五个终端命令和实用程序(不分先后顺序),可帮助您感到自己渴望成为向导! 这是基于Ubuntu的,但在其他平台上应该类似(可能会有一点谷歌搜索)。

If you want to mention how to achieve similar results on MacOS or Windows, or there are other terminal tricks you would like to share, let me know in the comments below.

如果您想提一下如何在MacOS或Windows上获得类似的结果,或者想分享其他终端技巧,请在下面的评论中告诉我。

This is adapted from my recent YouTube video, which you can view to see these tricks in action!

这是根据我最近的YouTube视频改编而成的,您可以观看该视频以了解这些技巧!

须藤!! (sudo !!)

sudo !! (or as I like to shout SUDO BANG BANG) will repeat the last command you typed, but with sudo in front of it.

sudo !! (或者我喜欢大喊SUDO BANG BANG)将重复您键入的最后一个命令,但前面要加上sudo

If you have ever forgotten to use your sudo privilege when doing something that needs your administrator credentials (such as apt updatefor example), then sudo !! is a handy way to correct it without having to type the whole command again.

如果您在做一些需要管理员凭据的操作时忘记了使用sudo特权(例如apt update ),那么sudo !! 是纠正它的便捷方法,而无需再次键入整个命令。

蒂格 (tig)

tig and tig status are probably the tools I use most often in my day-to-day work.

tigtig status可能是我在日常工作中最常使用的工具。

The eagle-eyed among you may have noticed that this is git spelled backwards, and indeed tig is an excellent git utility.

你们中间的鹰眼人士可能已经注意到,这是git反向拼写,而tig确实是一个出色的git实用程序。

One of gits shortcomings for me is the lack of interactivity available in some of the basic actions. For example, while git log and git status give me useful information, it requires more manual git commands to do anything useful with that information.

对我来说,git的缺点之一是某些基本操作中缺乏交互性。 例如,虽然git loggit status为我提供了有用的信息,但它需要更多手动git命令才能对该信息执行任何有用的操作。

tig acts like git log, but allows you to navigate up and down the log, and examine the contents of each commit from the command line.

tig行为类似于git log ,但允许您上下浏览日志,并从命令行检查每个提交的内容。

tig status acts like git status except that it also allows for the same navigation as tig, and it also allows you to add files to staging easily from the command line.

tig status行为类似于git status除了它还允许与tig相同的导航之外,它还允许您从命令行轻松地将文件添加到暂存中。

Both commands can be navigated using the j and k keys to move up and down, and pressing enter will open the information about the file (such as the commit diff). q also exits out of each command.

可以使用jk键上下移动两个命令,然后按enter将打开有关文件的信息(例如commit diff)。 q也退出每个命令。

To add or remove specific files from your staging area in git, simply press u.

要在git的暂存区中添加或删除特定文件,只需按u

Now when you go to git commit... as usual, your  files have already been added, so no need to use the git add command.

现在,当您像往常一样转到git commit... ,您的文件已经添加完毕,因此无需使用git add命令。

grep (grep)

This is a very well known 'trick' but it's incredibly useful all the same.

这是一个非常著名的“把戏”,但同样有用。

grep allows you to return the relevant lines from text output that match a particular pattern you pass it.

grep允许您从文本输出中返回与您传递的特定模式匹配的相关行。

For example, if you are looking in a long .log file for an error, it can be hard to see amongst all irrelevant output. Grep can narrow down your search to only the relevant lines.

例如,如果您正在一个长的.log文件中查找错误,则可能很难在所有不相关的输出中看到该错误。 Grep可以将搜索范围缩小到相关行。

E.g. grep error system.log

例如grep error system.log

With other commands that produce lots of terminal output, you can pipe it to grep error to do the same. For example, if you wanted to look at your Rails routes, but you were only interested in those related to admin you could do this:

使用产生大量终端输出的其他命令,您可以将其传递给grep error以执行相同的操作。 例如,如果您想查看Rails路线,但是只对与admin相关的那些感兴趣,则可以执行以下操作:

rake routes | grep admin

rake routes | grep admin

历史 (history)

history simply returns every command you have ever typed into your terminal. Why is this useful? Well, if, like me, you are super forgetful, the history command can show you what you've done before to jog your memory.

history只是返回您曾经在终端中键入的每个命令。 为什么这有用? 好吧,如果像我一样,您超级健忘, history命令可以向您显示您在记忆之前所做的事情。

For example, whenever I have to restore a database back-up, I can never remember the syntax. history | grep pg_restore will show me every time I've used the pg_restore command, with the exact flags and arguments I had to use.

例如,每当我必须还原数据库备份时,我就永远不会记住语法。 history | grep pg_restore 每次使用pg_restore命令时, history | grep pg_restore都会显示给我,并提供我必须使用的确切标志和参数。

Notice the use of grep to narrow down the search? Work smart, not hard!

注意使用grep缩小搜索范围了吗? 聪明地工作,不难!

快速检测 (spd-say)

This one can be achieved a number of ways, and with various tools on each platform. spd-say is the default Ubuntu text-to-speech utility.

可以通过多种方法以及在每个平台上使用各种工具来实现这一目标。 spd-say是默认的Ubuntu文本语音转换实用程序。

Using your terminal's ability to chain commands, you can use your speech utility tool of choice to tell you when a long running process has finished.

利用终端机链接命令的能力,您可以使用自己的语音实用工具来告诉您长时间运行的过程何时结束。

Example: sudo apt update; spd-say done

示例: sudo apt update; spd-say done sudo apt update; spd-say done

Notice the ; between the commands? This will basically run the apt update to completion and then invoke the next command. In this case it will helpfully say 'done' when it's finished.

注意; 命令之间? 基本上,这将使apt update运行完成,然后调用下一个命令。 在这种情况下,完成时会说“完成”。

Feel free to make it say 'booyah!' if you feel like your day needs more celebrations of tiny wins in it.

随意说“嘘!” 如果您觉得自己的一天需要更多庆祝微小胜利的日子。



与我分享你的! (Share yours with me!)

Devs love two things: laptop stickers and snazzy terminal commands. I've run out of room for stickers, but I'd love to hear your favourite terminal commands in the comments below!

开发人员喜欢两件事:笔记本电脑贴纸和时髦的终端命令。 我已经没有足够的空间来放置贴纸了,但是我很想在下面的评论中听到您最喜欢的终端命令!

You can also connect with me on Twitter @JacksonBates

您也可以通过Twitter @JacksonBates与我联系

翻译自: https://www.freecodecamp.org/news/terminal-tricks/

终端软件升级功能开发

相关文章:

自定义左右侧滑菜单

实现效果: 左右侧滑菜单,侧滑栏占主屏比为60%监听触控,自定义滑动动画,当侧边栏滑动超过50%松开触控将自动滑动到60%,未超过50%松开触控回归侧边栏隐藏为主屏设置蒙版效果,根据侧滑菜单的占屏比设置主屏蒙版…

uniapp设置模板路径页面样式混乱解决办法

乱了就在html里面加上下面这行代码试试 <link rel"stylesheet" href"<% BASE_URL %>static/index.css" /> <meta name"viewport" content"widthdevice-width, initial-scale1.0, user-scalableno, minimum-scale1.0, maxim…

JavaScript获取当前日期,昨天,今天日期以及任意天数间隔日期

<script language"JavaScript" type"text/javascript"> function GetDateStr(AddDayCount) { var dd new Date(); dd.setDate(dd.getDate()AddDayCount);//获取AddDayCount天后的日期 var y dd.getYear(); var m dd.getMonth()1;//获取当前月份…

snapd_snapd使管理Nextcloud变得轻而易举

snapdAs I’ve described in both my Linux in Action book and Linux in Motion course, Nextcloud is a powerful way to build a file sharing and collaboration service using only open source software running on your own secure infrastructure. It’s DropBox, Skyp…

atitit.跨架构 bs cs解决方案. 自定义web服务器的实现方案 java .net jetty  HttpListener...

atitit.跨架构 bs cs解决方案. 自定义web服务器的实现方案 java .net jetty HttpListener 1. 自定义web服务器的实现方案&#xff0c;基于原始socket vs 基于tcpListener vs 基于HttpListener1 2. download1 3. Lib3 4. Code3 5. HttpListener类4 6. Reef5 1. 自定义web服务器…

Python高级函数--map/reduce

名字开头大写 后面小写&#xff1b;练习&#xff1a; 1 def normalize(name): 2 return name[0].upper() name[1:].lower() 3 L1 [adam, LISA, barT] 4 L2 list(map(normalize, L1)) 5 print(L2) reduce求积&#xff1a; 1 from functools import reduce 2 3 def prod(…

样式集(9) - 切换Tab菜单

先上效果图 下面是以vue实现的示例代码&#xff1a; 代码解析&#xff1a; 很简单的代码&#xff0c;直接复制粘贴使用吧~ 别忘记一键三连哦&#xff0c;点赞&#xff0c;收藏&#xff0c;关注&#xff0c;谢谢~ 后续持续更新更多干货哦&#xff01;&#xff01; <temp…

python字典{:4}_Python字典101:详细的视觉介绍

python字典{&#xff1a;>4}欢迎 (Welcome) In this article, you will learn how to work with Python dictionaries, an incredibly helpful built-in data type that you will definitely use in your projects.在本文中&#xff0c;您将学习如何使用Python字典&#xff…

asp.net提交危险字符处理方法之一

在form表单提交前&#xff0c;可以在web页面&#xff0c;submit按钮的click事件中&#xff0c;使用js函数对&#xff0c;可能有危险字符的内容进行编码。 有3个函数可用&#xff1a; encodeURI() 函数可把字符串作为 URI 进行编码。 escape() 函数可对字符串进行编码&#xff0…

mysql帐号,权限管理

-> use mysql; //选择数据库 -> select host,user,password from user; //查询已有用户 -> insert into user (host,user,password) values(localhost,kiscms,password(kiscms)); //插入一个用户 -> select host,user,password from user; //再次查询用户 -> fl…

样式集(10) - 滑动删除功能实现,VUE完整源码附效果图

先看效果图 实现方式&#xff1a; 使用 scroll-view 标签&#xff0c;进行横向滑动&#xff0c;达到左滑出现删除按钮&#xff0c; 注&#xff1a;如果不是使用uni-app或者小程序框架&#xff0c;没有 scroll-view 组件的话可以通过CSS实现哦 下面看uni-app的实现代码&#…

机器学习关键的几门课程_互联网上每门机器学习课程,均按您的评论排名

机器学习关键的几门课程by David Venturi大卫文图里(David Venturi) 互联网上每门机器学习课程&#xff0c;均按您的评论排名 (Every single Machine Learning course on the internet, ranked by your reviews) A year and a half ago, I dropped out of one of the best com…

[POJ2104]K-th Number(区间第k值 记录初始状态)

题目链接&#xff1a;http://poj.org/problem?id2104 给n个数和m个查询&#xff0c;查询[i, j]内第k小的数是多少。&#xff08;主席树、划分树那种高大上的姿势叒不会啊QAQ 可以在维护这n个数的同时维护刚刚输入的时候他们的下标&#xff0c;之后预处理排序一次&#xff0c;查…

Geant4采用make和cmake编译运行geant4自带例子的方法

该教程介绍如何将geant4中自带的例子通过camke编译成可执行文件&#xff0c;并运行程序。 1 在linux主目录下创建一个geant4_workdir目录&#xff0c;并将geant4自带的例子B1复制到该目录下&#xff0c;如图1所示&#xff0c;geant4自带的B1源文件所在目录为geant4安装目录&…

GitLab设置中文

第一步&#xff0c;点击右上角的头像 点击Preferences&#xff0c;选择语言 选择简体中文然后保存

java python算法_用Python,Java和C ++示例解释的排序算法

java python算法什么是排序算法&#xff1f; (What is a Sorting Algorithm?) Sorting algorithms are a set of instructions that take an array or list as an input and arrange the items into a particular order.排序算法是一组指令&#xff0c;这些指令采用数组或列表…

c++运算符重载总结

c的一大特性就是重载(overload)&#xff0c;通过重载可以把功能相似的几个函数合为一个&#xff0c;使得程序更加简洁、高效。在c中不止函数可以重载&#xff0c;运算符也可以重载。由于一般数据类型间的运算符没有重载的必要&#xff0c;所以运算符重载主要是面向对象之间的。…

一道面试题:js返回函数, 函数名后带多个括号的用法及join()的注意事项

博客搬迁&#xff0c;给你带来的不便&#xff0c;敬请谅解&#xff01; http://www.suanliutudousi.com/2017/11/13/js%E8%BF%94%E5%9B%9E%E5%87%BD%E6%95%B0%E4%B8%AD%EF%BC%8C%E5%87%BD%E6%95%B0%E5%90%8D%E5%90%8E%E5%B8%A6%E5%A4%9A%E4%B8%AA%E6%8B%AC%E5%8F%B7%E7%9A%84%E…

小程序画布画海报保存成图片可以保存实现完整代码

老规矩先来个效果图&#xff1a; 因为是截图所以会有些模糊&#xff0c;在真机上会比较清晰 下面针对效果图来看看里面都画了什么元素&#xff0c;代码在文章的最后&#xff0c;大家想直接拷代码可以略过这&#xff0c;这里是方便大家理解代码。 首先&#xff0c;咱们的海报有…

fcm和firebase_我如何最终使Netlify Functions,Firebase和GraphQL一起工作

fcm和firebaseIn a previous post I confessed defeat in attempting to get an AWS Lambda GraphQL server to connect to a Firebase server. I didn’t give up right away, though, and a short time later found a different Node package to achieve what I couldn’t be…

深入了解Mvc路由系统

请求一个MVC页面的处理过程 1.浏览器发送一个Home/Index 的链接请求到iis。iis发现时一个asp.net处理程序。则调用asp.net_isapi 扩展程序发送asp.net框架 2.在asp.net的第七个管道事件中会遍历UrlRoutingModule中RouteCollection的RoteBase集合 通过调用其GetRouteData方法进行…

uni-app h5页面左上角出现“取消“字眼解决办法

在项目根目录的index.html中加上一行代码 <link rel"stylesheet" href"<% BASE_URL %>static/index.<% VUE_APP_INDEX_CSS_HASH %>.css" /> 如图&#xff1a;

unity编辑器扩展_01(在工具栏中创建一个按钮)

代码&#xff1a; [MenuItem("Tools/Test",false,1)] static void Test() { Debug.Log("test"); } 注意&#xff1a;MenuItem中第一个参数:需要创建选项在工具栏中的路径&#xff0c;此路径的父目录可以是Unity中已存在的&#xff0c;也…

postgres语法_SQL Create Table解释了MySQL和Postgres的语法示例

postgres语法A table is a group of data stored in a database.表是存储在数据库中的一组数据。 To create a table in a database you use the CREATE TABLE statement. You give a name to the table and a list of columns with its datatypes.要在数据库中创建表&#…

jquery-ajax请求:超时设置,增加 loading 提升体验

前端发送Ajax请求到服务器&#xff0c;服务器返回数据这一过程&#xff0c;因原因不同耗时长短也有差别&#xff0c;且这段时间内页面显示空白。如何优化这段时间内的交互体验&#xff0c;以及长时间内服务器仍未返回数据这一问题&#xff0c;是我们开发中不容忽视的重点。 常见…

第三章.SQL编程

2016年3月2日13:55:17(记忆笔记) 变量是存储数据的容器。 如何在SQL中定义自己的变量&#xff01; First:第一套变量定义 整型 Declare num int Set num10 Print num 第二套变量定义 字符串类型(char varchar nvarchar) Declare name nvarchar(32) Set name’小帅’ Pri…

移动端自动播放音视频实现代码

视频组件 <video :custom-cache"false" :src"item.voideoUrl" :id"audio index" :vslide-gesture-in-fullscreen"false" :direction0 :enable-progress-gesture"false" :show-fullscreen-btn"false" loop obj…

grafana美人鱼_编码美人鱼–我如何从海洋生物学家转到前端开发人员

grafana美人鱼I have wanted to share my story for a while, but I didn’t know exactly how to start, or even what name to give it. 我想分享我的故事一段时间&#xff0c;但我不知道确切的开头&#xff0c;甚至不知道用什么名字。 But recently I was talking with som…

网络安全基础扫盲

1. 名词解释 APT 高级持续性威胁。利用先进的攻击手段对特定目标进行长期持续性网络攻击的攻击形式。其高级性主要体现在APT在发动攻击之前需要对攻击对象的业务流程和目标系统进行精确的收集。 VPN 虚拟专用网络&#xff08;Virtual private network&#xff09; VPN是Virtual…

Install Package and Software

svn http://tortoisesvn.sourceforge.net/ git https://download.tortoisegit.org/ http://git-for-windows.github.io/转载于:https://www.cnblogs.com/exmyth/p/5246529.html