.aliases

From Rohidekar

Jump to: navigation, search

Deprecated

#===============================================================================
#
# DESCRIPTION
#   My personal Linux aliases
#
# CONTACT
#   Sridhar Sarnobat
#
# DATE
#   13 Nov 07
#
# NOTES
#   (-) You can have an alias to itself
#   (-) Pipes in alias definitions must be escaped
#   (-) To change line wrapping, go to .XDefaults's xterm*autoWrap
# 
#===============================================================================

#echo "Executing .aliases_public"


# Legal colors here: /usr/lib/X11/rgb.txt
alias  xemacs                   xemacs -bg pink2
alias  xm                       xemacs \&
alias  fx                       xterm_fix

#===============================================================================
#                               Counting
#===============================================================================

alias  count_lines		wc -l
alias  count_words		wc -w
alias  count_chars		wc -c
alias  word_count               count_words
alias  line_count		count_lines
alias  char_count		count_chars
alias  lc                       count_lines
alias  cc                       count_chars

#===============================================================================
#                                Shell
#===============================================================================

#-------------------------------------------------------------------------------
#                               Terminal
#-------------------------------------------------------------------------------
alias	h	                history
alias  cls                      clear
alias  e			exit
alias  df			df -h
alias  dsk                      disk_usage
alias  p			pwd
alias  c                        cd
alias  bk                  'source ~/bin/bindkey_readable'
# Don't show the directory stack after a cd to a CDPATH destination
#alias  cd                       'cd > /dev/null'

#-------------------------------------------------------------------------------
#                          File Manipulation
#-------------------------------------------------------------------------------
alias  mkdir			mkdir -p
alias  rmd                      rmdir
alias  mv			mv -i
alias  cp			cp -i
# echo    "Now executing .aliases"

#-------------------------------------------------------------------------------
#                           Change Directory
#-------------------------------------------------------------------------------
# TODO SSARNOBA - you can't call a script to change directory
#alias  cdf                      change_directory_file
alias  cdd                      'cd `dir_deepest`'
alias  cdr                      'cd `find_dir_name \!^ | head -1`';

# change to directory for file path
alias  cdfp                      'cd `dirname \!^`';

# change to directory containing file
alias  cdf                      'cd `find_dir_for_file \!^`';

alias  gd                       get_directory
alias  gp                       get_path

#-------------------------------------------------------------------------------
#                                 Find
#-------------------------------------------------------------------------------
alias  f                        find
alias  ff			find_files
alias  fn                       find_file_name
alias  fdir			find_dir_name
alias  fnd                      find_dir_name
alias  fdr                      find_dir_name
alias  find_h                   find_horizontal_list
alias  fh                       find_horizontal_list

#-------------------------------------------------------------------------------
#                           Directory Stack
#               If pushdtohome is set, pushd without arguments does 'pushd ~', 
#               like cd.
#
#               Finally, all forms of pushd print the final directory stack,
#               just like dirs. The pushdsilent shell variable can be set to
#               prevent this 
#-------------------------------------------------------------------------------
alias  d                        'dirs -v | grep --invert-match --perl-regexp ''^0'' | sort --reverse'

# SSARNOBA TODO - you could alias cd to pushd if you set pushdtohome

# SSARNOBA TODO - This makes you move to $HOME after finishing the command
# We don't want that
#alias  pd                       "pushd $PWD"
alias  pd                       "pushd"

#SSARNOBA TODO - create a command dirs_clear to purge the directory stack
# But first you need to find out what the flag to do so is.

#-------------------------------------------------------------------------------
#                                 Grep
#
# This doesn't work when I put it in the aliases file --exclude="*~"
# but does when I put it in the command line
#
#       -P, --perl-regexp
#              Interpret PATTERN as a Perl regular expression.
#
#       -i, --ignore-case
#              Ignore case distinctions in both  the  PATTERN  and  the  input
#              files.
#       -v, --invert-match
#              Invert the sense of matching, to select non-matching lines.
#       -l, --files-with-matches
#              Suppress  normal  output;  instead print the name of each input
#              file from which output would normally have been  printed.   The
#              scanning will stop on the first match.
#
#       -L, --files-without-match
#              Suppress  normal  output;  instead print the name of each input
#              file from which no output would  normally  have  been  printed.
#              The scanning will stop on the first match.
#       -h, --no-filename
#              Suppress  the  prefixing  of  filenames on output when multiple
#              files are searched.
#       -s, --no-messages
#              Suppress error messages about nonexistent or unreadable  files.
#              Portability  note:  unlike  GNU  grep, traditional grep did not
#              conform to POSIX.2, because traditional grep lacked a -q option
#              and  its  -s  option  behaved like GNU grep~s -q option.  Shell
#              scripts intended to be  portable  to  traditional  grep  should
#              avoid  both  -q  and -s and should redirect output to /dev/null
#              instead.
#       
#-------------------------------------------------------------------------------

alias	grep			grep --binary-files=without-match \
                                  --ignore-case --perl-regexp --no-messages
alias   g                       grep

#===============================================================================
#                     ls - List Directory Contents
#===============================================================================

#-------------------------------------------------------------------------------
#       -o     like -l, but do not list group information
#       -h, --human-readable
#              print sizes in human readable format (e.g., 1K 234M 2G)
#       -B, --ignore-backups
#              do not list implied entries ending with ~
#       -X     sort alphabetically by entry extension
#       -r, --reverse
#              reverse order while sorting
#       -t     sort by modification time
#       -A, --almost-all
#              do not list implied . and ..
#       -G, --no-group
#              inhibit display of group information
#       --sort=WORD
#              extension -X, none -U, size -S, time -t, version -v
#              status -c, time -t, atime -u, access -u, use -u
#       -x     list entries by lines instead of by columns
#-------------------------------------------------------------------------------

alias   ls                      `alias ls` $LS_OPTIONS
alias	l	                ls_long
alias   ls_long                 ls -oXtA \
                                  --reverse        \
                                  --ignore-backups \
                                  --human-readable \
                                  --no-group
#-------------------------------------------------------------------------------
#       -x     list entries by lines instead of by columns
#-------------------------------------------------------------------------------
alias  ls_display_horizontal    ls -x

#-------------------------------------------------------------------------------
#       -X     sort alphabetically by entry extension
#-------------------------------------------------------------------------------
alias  ls_sort_by_extension	ls -X
alias  ls_sort_by_type	        ls -X

#-------------------------------------------------------------------------------
#       -m     fill width with a comma separated list of entries
#-------------------------------------------------------------------------------
alias  ls_display_comma         ls -m

#-------------------------------------------------------------------------------
#       -1     list one file per line
#-------------------------------------------------------------------------------
alias  ls_display_single_column ls -m

#-------------------------------------------------------------------------------
#       -U     do not sort; list entries in directory order
#-------------------------------------------------------------------------------
alias  ls_sort_by_none          ls -U

#-------------------------------------------------------------------------------
#       --color[=WHEN]
#              control  whether color is used to distinguish file types.  WHEN
#              may be ~never~, ~always~, or ~auto~
#-------------------------------------------------------------------------------
alias  ls_display_color         ls --color=auto

#===============================================================================
#                                 Date
#===============================================================================

alias  date_code                date_human_readable
alias  date_hr                  date_human_readable	
alias  date_num 		date_numerical_sortable	
alias  date_rev                 date_human_readable
alias  date_revision		date_human_readable
alias  ssarnoba_date            date_human_readable

#===============================================================================
#                                 Java
#===============================================================================

alias  jar_contents             jar_file_list           

#===============================================================================
#                             NOT WORKING
#===============================================================================

#alias  cd                     'cd  !^; dirs'; # CAN'T GET THIS WORKING
#alias  jdev			/jdevbin/pf l jdevfusionclass practices # For fusion
#alias  precmd date
# Keep the current emacs directory in sync
#alias  precmd			'dirs>/dev/null'
#alias  whorefs                 lid
#setenv SQLPATH ~;
#echo    "Finished executing .aliases"
Personal tools