Linux Search and Replace DEATHMATCH! | Into the Terminal 129

preview_player
Показать описание
What is YOUR favorite way to search and replace in Linux? In this episode Scott and Nate are going to share with you their favorite methods of replacing a bunch of text at the command line! Will we use emacs (shudder)? Sed? Perl? Will your favorite method be covered? Tune in to find out!
- - - - -

Critical Administration Skills for Red Hat Enterprise Linux: Whether you are new to Linux or new to RHEL, join our hosts for a hands-on look into the commands and processes, ask questions, and grow your knowledge.

Рекомендации по теме
Комментарии
Автор

So good to see - real sysadmins seems to prefer perl ;)

Thalamus
Автор

Sharing two that I enjoy as well:
- `!^`, first argument from the last command. I use it a lot to create a directory and change into it: `mkdir foooo` then `cd !^`.
- `!$` or `M-.` (Alt-.), last argument from the last command. I mostly use it to change permissions/ownership after copying a file: `cp foo.txt ./foooo/bar.txt` then `chmod 400 (!$ or M-.)`. (Just saw Scott mentioned it)

Love this show! I missed a couple of episodes, but I’m catching up.

(P.S.: My beloved Emacs also shines when it comes to searching and replacing across multiple files, even over SSH. One can export the output of `rg` into a buffer, then check and perform the replacement operations restricted to that buffer. Not saying that everyone should be doing it this way or anything. Just showing some love for my ancient but powerful parentheses machine hehe)

ttybitnik
join shbcf.ru