命令行快速删除当前行

There are a lot of command line tips and trics in the internet. Most of them discribe the trivials like "learn the hotkeys" or "sudo !! will run previous command with sudo". Instead of that, I will tell you what to do when you have already learned the hotkeys and know about sudo !!.

互联网上有很多命令行提示和指标。 他们中的大多数都将琐碎的事情描述为“学习热键”或“ sudo !!将使用sudo运行先前的命令”。 取而代之的是,当您已经学会了热键并了解sudo !!时,我会告诉您该怎么做sudo !!

终端应立即启动 (The terminal should start instantly)

How much time you spend to launch a terminal? And another one? For a long time I've used Ctrl+Alt+T shortcut to launch a terminal and I thought it is fast. When I've migrated from Openbox to i3, I began to launch a terminal via Win+Enter, that binding worked out of the box. You know what? Now I don't think that Ctrl+Alt+T is fast enough.

您花费多少时间启动终端机? 还有一个? 很长时间以来,我一直使用Ctrl + Alt + T快捷方式启动终端,我认为它很快。 从Openbox迁移到i3后,我开始通过Win + Enter启动终端,该绑定开箱即用。 你知道吗? 现在,我认为Ctrl + Alt + T不够快。

Of course, the thing is not a millisecond speedup, but that you open a terminal at the level of reflexes, completely oblivious to that.

当然,这不是毫秒级的提速,而是您在反射级别打开终端,完全没有意识到。

So, if you often use a terminal, but grab a mouse for launching it, try to configure a handy hotkey. I'm sure, you will like it.

因此,如果您经常使用终端,但是抓住鼠标来启动它,请尝试配置方便的热键。 我敢肯定,你会喜欢的。

Zsh代替Bash (Zsh instead of Bash)

This is a holywar topic, I know. You should install Zsh for at least three features: advanced autocompletition, typo correction and multiple pathname completition: when a single Tab converts /u/s/d into /usr/share/doc. Arch Linux has already migrated to Zsh in it's installation CD. I hope Zsh will once become a default shell in Ubuntu. That will be a historical moment.

我知道这是一个神圣的话题。 您应该为至少三个功能安装Zsh:高级自动完成,错字校正和多个路径名完成:当单个Tab将/u/s/d转换为/usr/share/doc 。 Arch Linux已经在其安装CD中迁移到Zsh。 我希望Zsh能够成为Ubuntu中的默认Shell。 那将是一个历史性的时刻。

Starting to use Zsh is not difficult at all. Just install it via package manager and find a pretty config. I recommend to take config used in Arch Linux:

开始使用Zsh一点也不困难。 只需通过包管理器安装它,然后找到一个漂亮的配置即可。 我建议采用Arch Linux中使用的配置:

$ wget -O ~/.zshrc https://git.grml.org/f/grml-etc-core/etc/zsh/zshrc

The only thing left is to change your default shell and relogin.

剩下的唯一一件事就是更改您的默认Shell并重新登录。

$ chsh -s $(which zsh)

Thats all, just keep working like nothing happened.

仅此而已,就像什么都没有发生一样,继续工作。

shell提示应该是什么样子 (How the shell prompt should look like)

Shell prompt is a small piece of text shown in the terminal at the beginning of your command line. It should be configured for your kind of work. You can perceive it as a dashbord of a vehicle. Please, put some useful information there, let it help you navigate! Make it handy especially if you see it every day!

Shell提示符是命令行开头在终端中显示的一小段文本。 应该为您的工作进行配置。 您可以将其视为车辆的仪表板。 请在此放置一些有用的信息,以帮助您导航! 方便使用,尤其是每天都看到的时候!

Shell prompt should be colored. Do not agree? Try to count how many commands were executed in this terminal:

Shell提示应为彩色。 不同意? 尝试计算在此终端中执行了多少命令:

And now with color:

现在带有颜色:

Shell prompt should display a current working directory of a shell. If current working directory is not displayed, you have to keep it in mind and periodically check it with pwd command. Please don't do that. Keep in mind some really important things and don't waste your time for pwd command.

Shell提示符应显示Shell的当前工作目录。 如果未显示当前工作目录,则必须牢记该目录,并使用pwd命令定期对其进行检查。 请不要那样做。 请记住一些非常重要的事情,不要浪费时间执行pwd命令。

If you sometimes switch to root account, you need a "current user" indication. The particular user name is often not important, but it's status (regular or root) is. The solution is to use color: red shell prompt for root and green for regular user. And you will never take over root shell as regular.

如果有时切换到root帐户,则需要“当前用户”指示。 特定的用户名通常并不重要,但是它的状态(常规或root)才是重要的。 解决方案是使用颜色:红色的shell提示输入根,绿色的提示给普通用户。 而且您将永远不会像常规那样接管root shell。

If you connect to servers using ssh, you need to distinguish your local and remote shells. For that purpose your shell prompt should contain a hostname, or even better — indicate an ssh connection.

如果使用ssh连接到服务器,则需要区分本地外壳程序和远程外壳程序。 为此,您的shell提示符应该包含一个主机名,或者甚至更好—指示ssh连接。

Shell prompt can show the exit code of the last command. Remember that zero exit code means a command exited successfully, non-zero — command exited unsuccessfully. You can obtain last command's exit code via echo $?, but typing all that is a damn long thing. Let the shell show you unsuccessfull exit instead.

Shell提示符可以显示最后一条命令的退出代码。 请记住,退出代码为零表示命令成功退出,非零表示命令未成功退出。 您可以通过echo $?获得上一条命令的退出代码echo $? ,但输入所有内容都是一件漫长的事情。 让外壳显示不成功的退出。

If you work with Git repos, it will be useful to see the repository status in shell prompt: current branch and the state of working directory. You will save some time on git status and git branch commands and won't commit to a wrong branch. Yes, the calculation of status may take significant time in fat repositories, but for me the pros outweight the cons.

如果您使用Git仓库,那么在shell提示符下查看存储库状态会很有用:当前分支和工作目录的状态。 您将在git statusgit branch命令上节省一些时间,并且不会提交到错误的分支。 是的,在脂肪储存库中,状态的计算可能会花费大量时间,但对我而言,不利因素超过了缺点。

Some people add clock to the shell prompt or even the name of a virtual terminal (tty), or some arbitrary squiggles. That's all superfluous. It's better to keep much room for commands.

有些人在shell提示中添加了时钟,甚至在虚拟终端(tty)的名称中添加了时钟,或者在一些任意的波形上添加了时钟。 都是多余的。 最好为命令留出更多空间。

Thats how my shell prompt looks like in different conditions:

那就是我的shell提示符在不同条件下的样子:

You can see on the screenshot that the terminal titlebar does the similar job. It's also a piece of a dashboard and it's also should be configured.

您可以在屏幕截图上看到终端标题栏执行了类似的工作。 它也是仪表板的一部分,还应该进行配置。

So, how all this stuff should be implemented in .zshrc? The PROMPT variable sets the left prompt and RPROMPT sets the right prompt. The EUID variable defines the status of a user (regular or root) and SSH_CLIENT or SSH2_CLIENT presence indicates ssh connection. So we can have a template:

那么,所有这些东西应该如何在.zshrc实现? PROMPT变量设置左提示,而RPROMPT设置右提示。 EUID变量定义用户(常规或root)的状态,并且SSH_CLIENTSSH2_CLIENT存在表示ssh连接。 所以我们可以有一个模板:

if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; thenif [[ $EUID == 0 ]]; thenPROMPT=...elsePROMPT=...fielse # not SSHif [[ $EUID == 0 ]]; thenPROMPT=...elsePROMPT=...fi
fi

I don't show the copy-paste-ready code since the exact implementation is a matter of taste. If you don't want to bother and the screenshot above is ok for you, than take my cofig from the Github.

我不显示可复制粘贴的代码,因为确切的实现只是一个问题。 如果您不想打扰,并且上面的屏幕截图适合您,那么请把我的cofig从Github中带走。

Summary:

摘要:

  • Colored shell prompt is a must have.彩色外壳提示是必须具备的。
  • The required minimum is a current working directory.最低要求是当前工作目录。
  • Root shell should be clearly visible.根壳应该清晰可见。
  • The name of a user don't care a payload if you use only one account.如果您仅使用一个帐户,则用户名不在乎有效负载。
  • The hostname is useful if you connect to servers via ssh, it's not mandatory if don't.如果通过ssh连接到服务器,则主机名很有用,如果不是,则不是必需的。
  • It's useful to see unsuccessful exit code of a last command.查看最后一个命令的失败退出代码很有用。
  • Git repo status saves time on git status and git branch commands and brings foolproof.

    Git回购状态节省了git statusgit branch命令的时间,并提供了万无一失的方法。

大量使用命令历史记录 (Heavily use the command history)

The most part of commands in your life you enter more than once, so it would be cool to pull them out from the history instead of typing again. All modern shells save a command history and provide several ways of searching through that history.

您一生中大部分命令都会多次输入,因此将其从历史记录中拉出而不是再次键入是很酷的。 所有现代外壳程序都保存命令历史记录,并提供了几种搜索历史记录的方式。

Perhaps you are already able to dig the history using Ctrl+R keybinding. Unfortunately it has two disadvantages:

也许您已经可以使用Ctrl + R键盘绑定来挖掘历史记录。 不幸的是,它有两个缺点:

  1. The command line should be empty to begin the search, i.e. in case "one began to type a command — remembered about the search" you have to clean out your typing first, then press Ctrl+R and repeat your input. That takes too long.命令行应该为空以开始搜索,例如,如果“有人开始键入命令-记住搜索”,则必须先清除键入内容,然后按Ctrl + R并重复输入。 太久了
  2. Forward search don't work by defaul since Ctrl+S stops the terminal.由于Ctrl + S会停止终端,因此默认搜索无法进行正向搜索。

The most fast and convenient type of search works this way:

最快速,最方便的搜索类型通过以下方式工作:

  1. You begin to type a command,您开始输入命令,
  2. you remember about the search,您还记得有关搜索的信息,
  3. you press a hotkey and the shell offers you commands from history that started the same way.按下热键,shell将以相同的方式从历史记录中提供命令。

For example you want to sync a local directory with a remote one using Rsync and you already did it two hours earlier. You type rsync, press a hotkey one or two times and the desired command is ready to be launched. You don't need to turn on the search mode first, the shell prompt don't change to (reverse-i-search)':, and nothing jumps anywhere. You're just scrolling through history the same way you press the arrows ↑↓ to scroll through previously entered commands but with additional filtering. That's damn cool and saves a lot of time.

例如,您想使用Rsync将本地目录与远程目录同步,而您已经在两个小时前完成了。 键入rsync ,按热键一两次,即可启动所需的命令。 您无需先打开搜索模式,shell提示符不会更改为(reverse-i-search)': :,并且任何地方都不会跳动。 您只是在浏览历史记录时,就像按箭头↑↓一样,在以前输入的命令中滚动,但具有其他过滤功能。 真是太酷了,节省了很多时间。

This kind of search don't work by default in Bash and Zsh, so you have to enable it manually. I have chosen PgUp for searching forward and PgDown for searching backward. It's far to reach them, but I've alredy made a habit. Maybe later I will switch to something closer like Ctrl+P and Ctrl+N.

默认情况下,这种搜索在Bash和Zsh中不起作用,因此您必须手动启用它。 我选择PgUp进行向前搜索,选择PgDown进行向后搜索。 到达他们很遥远,但我已经养成了习惯。 也许以后我会切换到更接近的位置,例如Ctrl + P和Ctrl + N。

For Bash you need to add a couple of strings to /etc/inputrc of ~/.inputrc:

对于Bash,您需要在~/.inputrc /etc/inputrc中添加几个字符串:

"\e[5~": history-search-backward
"\e[6~": history-search-forward

If you have taken a foreign complete .zshrc, it's highly probable that PgUp and PgDown already do the job. If not, then add to ~/.zshrc:

如果您使用了外国完整的.zshrc ,则很有可能PgUp和PgDown已经完成了该工作。 如果没有,则添加到~/.zshrc

bindkey "^[[5~" history-beginning-search-backward # pg up
bindkey "^[[6~" history-beginning-search-forward  # pg down

Fish and Ipython shells already have such a search binded to arrows ↑↓. I think that many users migrated to Fish just for the arrows behavior. Of course, it is possible to bind the arrows this way in both Bash and Zsh if you wish. Use this in /etc/inputrc of ~/.inputrc:

Fish和Ipython壳已经具有与箭头↑↓绑定的搜索。 我认为许多用户只是出于箭头行为而迁移到了Fish。 当然,如果您愿意,可以在Bash和Zsh中以这种方式绑定箭头。 在~/.inputrc /etc/inputrc~/.inputrc

"\e[A":history-search-backward
"\e[B":history-search-forward

And this for in ~/.zshrc:

这在~/.zshrc

autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search

It's curious that over time I began to write commands bearing in mind that later I will pull them out from history. Let me show you some techniques.

奇怪的是,随着时间的流逝,我开始编写命令时会牢记,稍后我会将它们从历史中撤出。 让我向您展示一些技巧。

Join the commands that always follow each other:

加入始终相互遵循的命令

# ip link set eth1 up && dhclient eth1
# mkdir /tmp/t && mount /dev/sdb1 /tmp/t

Absolute paths instead of relative let you run a command from any directory: vim ~/.ssh/config instead of vim .ssh/config, systemd-nspawn /home/chroot/stretch instead of systemd-nspawn stretch and so on.

绝对路径而不是相对路径使您可以从任何目录运行命令: systemd-nspawn /home/chroot/stretch vim ~/.ssh/config代替vim .ssh/configsystemd-nspawn /home/chroot/stretch代替systemd-nspawn stretch等。

Wildcard usage makes your commands more universal. I usually use it in conjunction with chmod and chown.

通配符的使用使您的命令更加通用。 我通常将它与chmodchown结合使用。

#  chown root:root /var/www/*.sq && chmod 644 /var/www/*.sq

键盘快捷键 (Keyboard shortcuts)

Here is the required minimum.

这是最低要求。

Alt+. — substitutes the last argument of the previous command. It's also may be accessed with !$. Ctrl+A, Ctrl+E — jumps to the beginning and the end of the line respectively. Ctrl+U, Ctrl+Y — cut and paste. It's handy when you type a complex command and notice that you need to execute another one first. Hmm, where to save the current input? Right here. Ctrl+W — kills one word before the cursor. It clears out the line when being pressed and hold. By default the input is saved to the clipboard (used for Ctrl+Y). Ctrl+K — cuts the part of the line after the cursor, adding it to the clipboard. Ctrl+A Ctrl+K quickly clears out the line. PgUp, PgDown, Ctrl+R — history search. Ctrl+L clears terminal.

Alt +。 —替换上一个命令的最后一个参数。 也可以使用!$进行访问。 Ctrl + A,Ctrl + E —分别跳至该行的开头和结尾。 Ctrl + U,Ctrl + Y —剪切和粘贴。 当您键入复杂的命令并注意到需要首先执行另一个命令时,这非常方便。 嗯,在哪里保存当前输入? 就在这儿。 Ctrl + W —杀死光标前的一个单词。 按住不放会清除该行。 默认情况下,输入保存到剪贴板(用于Ctrl + Y)。 Ctrl + K —剪切光标后的行部分,并将其添加到剪贴板。 Ctrl + A Ctrl + K快速清除该行。 PgUp,PgDown,Ctrl + R-历史记录搜索。 Ctrl + L清除终端。

键盘响应 (Keyboard responsiveness)

I want to show you a small setup that allows you to scroll, navigate and erase faster. What do we do when we want to erase something big? We press and hold Backspace and watch it runs back wiping characters. What is going on exactly? After Backspace is pressed, one character disappears, then goes a small delay, then autorepeat is triggered: Backspace erases characters one by one, like you hit it repeatedly.

我想向您展示一个小的设置,使您可以更快地滚动,导航和擦除。 当我们要擦除大的东西时我们该怎么办? 我们按住Backspace并观察它向后擦字符。 到底是怎么回事? 按下Backspace键后,一个字符消失,然后经过一小段延迟,然后触发自动重复:Backspace一次又一次擦除字符,就像您反复按下它一样。

I recommend you to adjust the delay and autorepeat frequency for the speed of your fingers. The delay is required when you want to erase only one character — it gives you the time to release a key. Too big delay makes you wait for an autorepeat. Not enough for you to be annoyed, but enough to slow down the transfer of your thoughts from the head to the computer. The bigger the autorepeat frequency is, the faster the text is being erased and the more difficult is to stop this process. The goal is to find an optimum value.

我建议您根据手指的速度调整延迟和自动重复频率。 如果您只想擦除一个字符,则需要延迟-它使您有时间释放密钥。 太大的延迟会使您等待自动重复。 这不足以让您感到烦恼,但足以减慢您的思想从头脑向计算机的转移。 自动重复频率越大,删除文本的速度越快,停止此过程就越困难。 目的是找到最佳值。

So, the magic command is:

因此,魔术命令是:

$ xset r rate 190 20

190 — delay duration in milliseconds, 20 — frequency in repeats per second.

190-延迟时间(以毫秒为单位),20-频率(每秒重复数)。

I recommend to start from these values and increase the delay bit by bit until false positives, then return a little. If the delay is too small, you won't be able to use the keyboard. To fix this an X-server or complete computer should be restarted. So, please be carefull.

我建议从这些值开始,并逐渐增加延迟,直到出现误报,然后再返回一点。 如果延迟太小,您将无法使用键盘。 要解决此问题,应重新启动X服务器或完整的计算机。 所以,请小心。

In order to save parameters you need to add this command somewhere in X autostart.

为了保存参数,您需要在X自动启动的某处添加此命令。

流程退出指示 (Process exit indication)

I often have to start some long-running processes: a fat backup, big data transfer, archive packing/extracting, package building an so on. Usually I start such a process, switch to another task and gaze occasionally if my long-runnig process has exited. Sometimes I dive too deep into work and forget about it. The solution is to add process exit notification that will take me out of trance.

我经常不得不开始一些长期运行的过程:繁琐的备份,大数据传输,归档打包/提取,打包构建等等。 通常,我会启动这样一个过程,切换到另一个任务,如果我的长时间运行过程已经退出,则偶尔会凝视。 有时我会投入太多工作而忘了它。 解决方案是添加流程退出通知,这将使我摆脱困境。

There are many tools for that purpose: notify-send, dzen2, beep, aplay, wall. All of them are good somehow, but don't work with ssh connection. That's why I use terminal beep:

有许多用于此目的的工具:通知发送,dzen2,蜂鸣,播放,挂墙。 所有这些都以某种方式很好,但是不适用于ssh连接。 这就是为什么我使用终端提示音:

$ long-running-command; echo $'\a'

ASCII encoding has 0x7 character, named bell. It is used to beep the PC speaker. PC-speaker is not a modern thing, not every computer has it and it's not heared in headphones. That's why some terminals use a so called visual bell. I use urxvt, and it performs visual bell by raising urgency flag. What is it? It's a thing used when a window want to tell you it is urgent.

ASCII编码具有0x7字符,名为bell 。 它用于蜂鸣PC扬声器。 PC扬声器不是现代事物,不是每台计算机都有它,而且耳机也听不到。 这就是为什么某些终端使用所谓的可视铃。 我使用urxvt,它通过提高紧急标志来显示视觉效果。 它是什么? 当窗口想告诉您紧急情况时,可以使用此功能。

You can check how your terminal reacts on bell character right now:

您现在可以检查终端对响铃字符的React:

$ sleep 3; echo $'\a'

Three seconds are given for you to switch to another window, it may be required.

您可能需要三秒钟才能切换到另一个窗口。

Unfortunately, not every terminal can display visual bell by raising urgency flag. I've checked the most popular.

不幸的是,并非每个终端都可以通过提高紧急标志来显示可视铃声。 我检查了最受欢迎的。

Terminal emulator visual bell as urgency flag
konsole may be enabled in preferences
urxvt yes
xfce4-terminal may be enabled in preferences
xterm no
cool-retro-term no
lxterminal no
gnome-terminal no
终端模拟器 可视铃作为紧急标志
康索尔 可以在首选项中启用
urxvt
xfce4终端 可以在首选项中启用
xterm 没有
冷静的长期 没有
终端 没有
侏儒终端 没有

It's too long to type echo $'\a', so I've made a wake alias.

输入echo $'\a'太长echo $'\a' ,所以我做了一个wake别名。

别名 (Aliases)

By default commands cp, scp and rm work non-recursively and that sucks! It's a damn bad legacy! Well, it may be fixed using aliases. But first let's look when non-recursive behavior can be useful.

默认情况下, cpscprm命令以非递归方式工作,这很糟糕! 这是该死的糟糕遗产! 好吧,可以使用别名对其进行修复。 但是首先让我们看看非递归行为何时有用。

$ mkdir foodir
$ cp * foodir

Only files will be copied into foodir, but not directories. The same situation goes with rm:

仅文件将被复制到foodir ,而不是目录。 rm同样的情况:

$ rm *

will delete only files and symlinks, but keep directories. But how often do you need this feature? I like to think that cp and rm always work recursively.

将仅删除文件和符号链接,但保留目录。 但是,您多久需要一次此功能? 我喜欢认为cprm总是递归工作。

Ok, but what about security? Maybe non-recursive behavior protects your files? There is one case when you have a symlink to the directory and you want to remove that symlink, but keep the directory. If a slash is appended (intentionally or occasionaly) to the directory name and the recursive mode is switched on via -r, the directory will become empty! EMPTY!

好的,但是安全性如何? 也许非递归行为可以保护您的文件? 在一种情况下,当您有指向目录的符号链接,并且想要删除该符号链接,但保留目录时。 如果在目录名称后附加(有意或无意)斜杠,并且通过-r启用了递归模式,则目录将为空! 空!

$ ln -s foodir dir_link
$ rm -r dir_link/

Without -r arg it will abuse and don't remove anything. So, recursive rm increases the risk of loosing data a little.

如果没有-r arg,它将滥用并且不会删除任何内容。 因此,递归rm增加了丢失数据的风险。

I turned on the recursive mode for cp, scp и rm, and also added -p for mkdir to create nested directories easily.

我打开递归模式cpscp и rm ,并且还增加了-pmkdir轻松创建嵌套的目录。

alias cp='cp -r'
alias scp='scp -r'
alias rm='rm -r'
alias mkdir='mkdir -p'

For two years I've never regretted about these aliases and never lost data. There is also a downside: it's possible to copy/remove less data, than it was needed and not get sight of it when working on the system without aliases. So, please be careful. I know what I do and always run rm with caution.

两年来,我从未为这些别名感到后悔,也从未丢失数据。 还有一个缺点:复制/删除的数据可能少于需要的数量,并且在没有别名的系统上工作时看不到它。 因此,请小心。 我知道我做什么,并总是谨慎地运行rm

The most popular are ls aliases and you probably already use them:

最受欢迎的是ls别名,您可能已经在使用它们:

alias ls='ls -F --color=auto'
alias la='ls -A'
alias ll='ls -lh'
alias lla='ll -A'

Also a colored grep is much more pretty than colorless:

另外,彩色grep比无色grep更漂亮:

alias grep='grep --colour=auto'

Aliases don't work in scripts, don't forget that fact! You have to explicitly specify all arguments.

别名在脚本中不起作用,请不要忘记这个事实! 您必须明确指定所有参数。

触摸打字 (Touch typing)

It's obvious, but I remind you: touch typing helps to type faster. It will be hard in the beginning, but you'll overcome the limits over time.

这很明显,但我提醒您:触摸打字有助于快速打字。 一开始会很困难,但是随着时间的推移,您将克服这些限制。

The best time to learn touch typing is vacation, when nobody bothers you. Please don't hurry when learning! Your goal is to memorize where each character is located, not so much with your mind, but with your fingers. It's better to type slow, but without mistakes rather than fast with mistakes. Remember that masters have good results not by fast fingers but not doing mistakes.

学习触摸打字的最佳时间是休假,没有人打扰您。 学习时请不要着急! 您的目标是记住每个角色的位置,而不是记住,而是记住。 最好输入慢速,但不要输入错误,而要输入快速而不输入错误。 请记住,大师们的成绩不是靠快速手指就能实现的,而不会犯错误。

Don't forget to take a break. Your brain and fingers need to take a rest. When mistakes begin to appear, that means you need to take a break.

不要忘记休息一下。 您的大脑和手指需要休息。 当错误开始出现时,这意味着您需要休息一下。

今天就这些 (That is all for today)

I hope these tips will really help you. Good luck!

希望这些提示对您有所帮助。 祝好运!

翻译自: https://habr.com/en/post/481940/

命令行快速删除当前行

命令行快速删除当前行_在命令行中快速有效地工作相关推荐

  1. vim中删除当前行后面所有的行

    1.删除当前行后面所有的行: ,$d 2.删除第一行到当前行: 1,.d (每次用了都忘记,此记)

  2. VBA实战技巧精粹017:如何快速删除空白单元格所在的行

    这个问题应该可以说几乎算不上问题的,就是从后往前逐个单元格进行检查就可以,只要为空,就将该单元格所在行删掉.但今天发现一个更快速的方法,利用specialcells方法,速度更快.冲着这个执行的速度, ...

  3. mac 命令行 解压7z文件_如何在Mac上快速压缩和解压文件?Mac上解压和压缩文件的方法...

    苹果mac电脑怎么压缩和解压文件?Mac电脑仅默认支持把文件压缩成zip格式,解压成zip.tar.gz,bz2等格式,有些操作需要安装第三方软件来完成,这篇文章为大家带来几种关于在Mac上解压和压缩 ...

  4. matlab命令行窗口显示长度设置_设置命令行窗口输出显示格式 | MATLAB format| MathWork...

    本页对应的中文页面未升级,但未能翻译. 若应查看最新内容,请点击这里访问英文页面. 设置命令行窗口输出显示格式 format 将命令行窗口中的输出显示格式修改为 style 指定的格式. format ...

  5. vue使用命令行构建完项目后_通过命令行创建vue项目的方法

    通过命令行创建vue项目的方法 最近想要学习vue,正好看到资料,如何通过命令创建vue项目的方法,就留个笔记 环境要求: 安装有 Node.js. vue.vue-cli . 创建项目: vue i ...

  6. aws 删除ec2实例_如何在AWS中启动EC2实例

    aws 删除ec2实例 你好朋友, 在本教程中,我们将看到如何立即在AWS中旋转EC2实例. 您应该有权访问AWS控制台.如果您还没有AWS账户,则可以单击此处并在AWS上创建免费套餐. 如何在AWS ...

  7. linux命令cd回退_GitHub - gmpy/cdirs: cdirs 用于在linux中快速切换目录,对庞大的项目工程效果显著.其基于标签且无缝取代cd命令,学习成本非常低...

    cdirs cdirs 用于在目录间任意跳转,对庞大的项目工程效果显著. 支持标签目录,支持任意目录跳转到标签标记的目录 支持回退目录,快速返回到上级目录,摆脱多次"../../../..& ...

  8. xp怎么更改锁定计算机的快捷键,xp锁定计算机快捷键_在Window XP中快速锁定计算机_xp怎么锁定计算机...

    1.快捷方式法 试着我们在桌面上新建一命令行中命令为"%windir%\System32\rundll32.exe user32.dll,LockWorkStation"的快捷方式 ...

  9. mysql数据库搜索字符_在MySQL数据库中快速搜索字符串?

    使用FULLTEXT搜索来快速搜索字符串.让我们首先创建一个表-mysql> create table DemoTable1554 -> ( -> Title text ->  ...

最新文章

  1. jquery获取元素的值,获取当前对象的父对象等等
  2. 光纤跳线接口的种类及适用范围
  3. python语法基础知识-python基础必学的语法知识
  4. php求二维矩阵的最大子矩阵,最大子矩阵-动态规划
  5. C语言指针转换为intptr_t类型
  6. linux phpunit 安装,在CentOS 7/CentOS 8系统中安装PHPUnit的方法
  7. spring boot: 支持jsp,支持freemarker
  8. Java拾遗:007 - 代理模式与动态代理
  9. LoadRunner 使用虚拟IP测试流程
  10. ListView的getFirstVisiblePosition等方法返回的是哪个对象
  11. shell下的常用语句
  12. java,二分查找法,网上查阅
  13. [藏]常用的匹配正则表达式和实例
  14. finereport 格式化金额函数_帆软报表常用函数总结
  15. Vray for UE4 (一)
  16. 【Qt】运行报错Could not create directory “E:\xxxx-Debug“
  17. html怎么改变图片整体大小,html怎么改变图片大小?
  18. C51单片机实验——7段数码管实验
  19. TCP协议接入电信物联网AEP(Aiot)新平台
  20. IMDG产品功能扩展

热门文章

  1. Libuv源码解析 - uv_loop整个初始化模块
  2. 30天数据分析与机器学习实践之Day16——Python文本数据分析:新闻分类任务
  3. android 涂鸦(清屏,画笔,粗细,保存)以及canvas源码学习
  4. 【YBT2022寒假Day8 A】染色计划(Tarjan)(线段树优化建边)(树链剖分)
  5. Notepad++ 设置tab为N个空格
  6. 《edge computing:vision and challenge》论文阅读
  7. 8421码 2421码 5421码和余3码的使用
  8. #每天一篇论文#(216/365)Adaptive Tracking Control of Nonholonomic Mobile Manipulators Using Recurrent Neura
  9. react项目中使用sass
  10. 前端学习: 用css设置文字样式