Skip to main content

Posts

Showing posts from September, 2019

My alias file for shotcut

#for alias itself alias aa='vim /home/lazy/.bash_aliases' #some random command alias pg='bash /home/lazy/.makeEasy/ping.sh' #for clear screen alias c='clear' alias cls='clear && ls' alias csl='clear && ls' alias lsc='clear && ls' alias lcs='clear && ls' alias slc='clear && ls' alias scl='clear && ls' alias wlan0='wlp6s0' #for Folders alias cdb='cd /home/lazy/Downloads/Browser' alias cdd='cd /home/lazy/Downloads' alias cdg='cd /home/lazy/Downloads/git' alias cdw='cd /home/lazy/ws' alias cdp='cd /home/lazy/Pictures' alias cdg='cd /home/lazy/Downloads/git' #wifi alias cdwifi='cd /home/lazy/ws/wifi' alias cdwf='cd /home/lazy/ws/wifi' alias wifi='cd /home/lazy/ws/wifi' #kismet alias cdkismet='cd /home/lazy/ws/wifi/kismet' alias cdkm='

my bashrc file for linux terminal

#####################################################################                                                 Start of code ##################################################################### # # ~/.bashrc # # If not running interactively, don't do anything #[[ $- != *i* ]] && return #alias ls='ls --color=auto' #PS1='[\u@\h \W]\$ ' ################################################################# ################################################################# #self added ################################################################# #for sudo work for auto completion if [ "$PS1" ]; then complete -cf sudo fi # set up to use vi command editing mode set -o vi #Allows you to cd into directory by typing the directory name shopt -s autocd ################################################################# # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/

How To Autocomplete Commands Preceded By 'sudo'

How To Autocomplete Commands Preceded By 'sudo'  When writing a command in the terminal, you can autocomplete it by pressing the TAB key. Example: type "nau" in the terminal and press TAB -> "nautilus" should show up (if you have Nautilus installed, obviously). However, the autocomplete doesn't work in Ubuntu if you are trying to run a command with "sudo". For example, typing "sudo nau" and then pressing the TAB key will not autocomplete the command to "sudo nautilus". Here is how to get autocomplete to work in the Terminal while using "sudo". Simply open the ".bashrc" hidden file from your home folder. If you use GNOME, paste this in a terminal to open it: sudo gedit ~/.bashrc Then paste this at the bottom of the file: if [ "$PS1" ]; then complete -cf sudo fi Then type this in a terminal to reload: bash Now try the example in the beginning of the file "sudo nau&qu

How to set up your shell to use vi command editing mode in Terminal

Most shells that have a command line editing feature support Emacs key bindings. (a tiny subset) Up Ctrl + P Down Ctrl + N Left Ctrl + B Right Ctrl + F Home Ctrl + A End Ctrl + E Delete Ctrl + D Alternatively, you could set up your shell to use vi command editing mode, by adding   set -o vi to your shell startup file (e.g., ~/.bashrc ).  Then, for example, you can Use Esc  k  Enter to re-execute the previous command (same as !! ).  The minus key - also works as a "move up" command. Use Esc  k  k  k  k  k  k  k  k  k  k  k   k Enter or Esc  1 2  k  Enter to re-execute the 12th previous command (same as !-12 ). Use Esc and a motion command (i.e., k , suitably repeated), and then edit the bash command line you find there.  Remember, you will still be in vi command mode, so you will need to use a vi editing command (e.g., I , A , C , R , or one of their lowercase counterparts) to actually add to the command from history. So, for examp

Random Posts