
Unix tool tip
@UnixToolTip
Tips on Unix utilities and related topics from @JohnDCook.
Bạn có thể thích
'The enjoyment of one's tools is an essential ingredient of successful work.' -- Donald E. Knuth
When giving numeric arguments to the find utility, + means greater than and - means less than. e.g. +7 means greater than 7.
In Emacs, to send the contents of a region to a shell command, use M-|.
"no Shakespeare yet -- only syntactically correct Bash scripts"

Legend has it gym memberships are particularly hard to cancel here because nobody knows how to exit

Replace string in a huge (70GB), one line, text file unix.stackexchange.com/questions/4136…
Trim leading and trailing whitespace: sed -i 's/^[ \t]*//;s/[ \t]*$//' somefile
Example from my latest blog post: sample a file with replacement, choosing 12 items: shuf -n 12 -r file.txt
Boolean operators in find: -not, -or. There's no 'and' because 'and' is implicit when two requirements are listed.
Seven habits of effective text editing moolenaar.net/habits.html // general principles, examples with Vim
Can show all environment variables with printenv. Probably want to pipe to less.
Repeat a shell command, replacing all instances of a word with something new johndcook.com/blog/2022/10/2…
Trim leading whitespace: sed -i 's/^[ \t]*//' somefile
'A successful software tool is one that was used to do something undreamed of by its author.' -- Stephen Johnson
Limit find's depth of search with the -maxdepth option.
If you only want to know whether two files differ, not how they differ, use diff -q (or --brief).
Awk can use a pair of regular expressions as a range, just like sed. In both languages, /foo/,/bar/ matches the same lines.
United States Xu hướng
- 1. D’Angelo 318K posts
- 2. Erika Kirk 52.9K posts
- 3. Charlie 590K posts
- 4. Young Republicans 18.8K posts
- 5. #PortfolioDay 19.2K posts
- 6. Politico 185K posts
- 7. Presidential Medal of Freedom 77.6K posts
- 8. Pentagon 109K posts
- 9. Jason Kelce 6,131 posts
- 10. Big 12 13.8K posts
- 11. Brown Sugar 22.7K posts
- 12. Drew Struzan 32.5K posts
- 13. Scream 5 N/A
- 14. Angie Stone 37.8K posts
- 15. David Bell N/A
- 16. Venables 4,077 posts
- 17. Burl Ives N/A
- 18. Milei 293K posts
- 19. Rose Garden 14.3K posts
- 20. George Strait 4,450 posts
Bạn có thể thích
-
Computer Science
@CompSciFact -
Regular Expression
@RegexTip -
Probability Fact
@ProbFact -
Algebra Etc.
@AlgebraFact -
Data Science Fact
@DataSciFact -
Scientific Python
@SciPyTip -
Analysis Fact
@AnalysisFact -
Ubuntu
@ubuntu -
The Linux Foundation
@linuxfoundation -
nixCraft 🐧
@nixcraft -
Differential Eqns
@diff_eq -
Topology Fact
@TopologyFact -
Logic & Applications
@LogicPractice -
Red Hat
@RedHat -
Docker
@Docker
Something went wrong.
Something went wrong.