Best of Bash

Best of Bash

Best of Bash sudo apt install <package_name> . install package_name alias aliasname='<command(s)>' . make an alias (temporary shortcut) cat <file> | xxd -b | more . print file in binary cd - . back to the previous directory cd ../.. go up a directory twice grep -r <str> . search current directory for str head -n <n> <file> . print from 0 to the nth line of the file tail –n <n> <file> . print from the nth line to the end of file hexdump -C <file> . print hex of file history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head –n <n> . print top n commands used ifconfig . see your network interfaces ifup <interface> . put interface up ifdown <interface> . take interface down ls -d */ . list only subdirectories from current dir ls -thor . .. list files by most recently modified thunar <file> . open files in default program touch {file1 file2. fileN} . create new empty files tree . ls but with a tree structure !! . run the last command again !!:* . run a command with previous args !<cmd> . run the most recent command that starts with cmd !<cmd>:p . print out the word that !$ would substitute !-1. run last command again !* . run last command again without first string !$ . run the last word of the previous command (same as Alt + .) Impress your friends: cowsay -l fortune | cowsay cowsay –f dragon | lolcat doge echo '<str>' | doge Resources: Permanent alias: http://www.hostingadvice.com/how-to/set-command-aliases-linuxubuntudebian/ Tmux (screen multiplexer): https://hackernoon.com/a-gentle-introduction-to-tmux-8d784c404340 Screen (screen multiplexer): https://www.tecmint.com/screen-command-examples-to-manage-linux-terminals/ Netcat: http://opensourceforu.com/2016/07/netcat-tcpip-swiss-army-knife/ vimrc: https://github.com/amix/vimrc tree: https://www.computerhope.com/unix/tree.htm .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us