What are some useful commands that you discovered or learnt on the terminal?

evnixevnix OG
edited November 2022 in Technical

as for me, it has been,

history | grep searchTerm

ctrl+a and ctrl+e move to the beginning or end of the line.

also, installing fzf was a massive productivity booster while doing things like ctrl+r (https://www.youtube.com/watch?v=qgG5Jhi_Els)

Update:

I 'll use the comments below to write a summary article here, these might be more useful than random commands on the web as these are likely heavily used by the community here.

search through history:

history | grep searchTerm

Install fzf to introduce partial/fuzzy search for history, files etc.

ctrl+a and ctrl+e move to the beginning or end of the line.

ctrl+LEFT|RIGHT arrow to jump words

CTRL+L clear screen

TAB for autocomplete

fdupes -Sr . FDUPES is a program for identifying duplicate files residing
within specified directories.

jdupes a faster fdupes

ncdu to work out where all the storage space went

tldr <command> an easy to read manpage

last reboot Shows reboot history

findmnt -l list all mounts

iftop realtime bandwidth monitoring

iostat -m 10 report to better balance the input/output load between physical disks

ss -tupan socket statistics.

scp localFilePath user@remote:/remote/file/path remote file transfer.

nload - shows per interface network usage live on a graph on your terminal.

Cool Stuff:

telnet 2001:7b8:666:ffff::1:42

Won't tell you what it is, but it is safe.

ani-cli animename episode

watch anime on the terminal

apt-get install sl sl
cures bad habit of mistyping ls

Combinations:

zfs send -w tank/dana@snap1 | ssh host2 zfs recv newtank/dana

ZFS send and recv.

du -k ./* | sort -nr | cut -f2 | xargs -d '\n' du -sh | less

useful for debugging diskspace

ls -a; uptime; exit

ps -C sshd o user,pid,comm,lstart as alternative to who

On a tmux session, open multiple panes, then do this:
Ctrl+B, Shift+;

Then type: setw sync on All panes will now type the same thing

type setw sync off to turn it off again.

*sh aliases: https://tldp.org/LDP/abs/html/aliases.html

external Tools:
https://doublecmd.sourceforge.io/
https://github.com/junegunn/fzf
https://github.com/nvbn/thefuck - auto corrects last command
https://github.com/kellyjonbrazil/jc - terminal output as json
http://www.figlet.org/ - text to ascii
https://books.goalkicker.com/BashBook/ - there are other good books there

Contributors: @jperkins @typicalGta @xleet @ralf @CamoYoshi @Neoon @ehab @legendary @hornet @shallow @Ympker @Encoders @iansss @Mumbly @msatt @cold @Calin @g4m3r @havoc @vyas @TheDP

Thanks for all the contributions :smile:

My Personal Blog 🌟🌟 Backups for $1 🔥🚀

Thanked by (2)ehab lemoncube
«1

Comments

Sign In or Register to comment.