4 ms·
First of all, you might want to check out the subreddit: /r/commandline https://www.reddit.com/r/commandline/ https://www.reddit.com/r/commandline/ general co
by veganjay 8y ago
First of all, you might want to check out the subreddit:
/r/commandline https://www.reddit.com/r/commandline/ https://www.reddit.com/r/commandline/
general commands
- awk/grep/sed/wc - text file processing
- convert (image magick) - image processing tool
- cpulimit - limit the cpu usage of a process
- fdupes - check for duplicate files and optionally remove them
- pdftk - concatenate pdf files and more - https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
- rsync - back up tool
- tmux - terminal multiplexer - almost always my first install
- tree - view directory contents in a tree format
- zcat/zmore - display a file that is compressed (e.g. zmore /var/log/syslog.2.gz)
security/reverse engineering:
- binwalk - search binary images for embedded files
- gdb + peda - debugger with extensions - https://github.com/longld/peda https://github.com/longld/peda
- nmap - network scanning tool
- radare2 - command line dissassembler - https://github.com/radare/radare2 https://github.com/radare/radare2
- scapy - network packet crafting - https://github.com/secdev/scapy https://github.com/secdev/scapy
- tshark - network traffic analyzer
- tcpdump - network traffic analyzer
- xxd - hexdump tool
Bonus:
- find - find files - I often use this to find files containing a string:
$ cat bin/findstring
#!/bin/sh
find . -type f -exec grep -i -l "$@" {} \;
- laumars 8y agoIf you're just using find to run grep against all files then you would be better off using the recursive flag in grep instead
- kjeetgill 8y agoI like the composition of tools, it lets you extend your usage pretty easily. I personally run this 20 times a day: find -name '*.java' | xargs grep 'pattern'
- laumars 8y agoBut at least there you're searching for specific files. I was talking only about running a find to launch an instance of grep for every file found. That's more keystrokes to get a slower result. For what it's worth, my biggest usage of find is similar to your java example (except a different file extension). I also do do '-exec sed...') a lot too.
- zokier 8y agoif you are piping to xargs, for love of god at least use -print0
- meowface 8y agoWith ag: ag -G java pattern
- turkeybacongod 8y agogrep has to be one of the most useful things i've ever used
- pvaldes 8y agofdupes is terrific, but I find that rdfind is an improved version. Can do useful things that fdupes can't. Pdftk is a must. I use pdflatex also a lot of course. And R and psql.