質問: .bashrcに追加できる便利なものは何ですか? soはるかに簡単になります。ここに私が使用するものがあります( 'diskspace'& 'folders'は特に便利です)。# some more ls aliases alias ll='ls -alh' alias la='ls -a' alias l='ls -cflh' alias woo='fortune' alias lsd="ls -alf | grep /$" # this is gold for finding out what is taking so much space on your drives! alias diskspace="du -s | sort -n -r |more" # command line mplayer movie watching for the win. alias mp="mplayer -fs" # show me the size (sorted) of only the folders in this directory alias folders="find . -maxdepth 1 -type d -print | xargs du -sk | sort -rn" # this will keep you sane when you're about to smash the keyboard again. alias frak="fortune" # this is where you put your hand rolled scripts (remember to chmod them) path="$home/bin:$path"
回答: 私はいくつかのビットを持っています:# stop the pc speaker ever annoying me :) setterm -bfreq 0 # don't put duplicate lines in the history. see bash(1) for more options histcontrol=ignoredups # ... and ignore same sucessive entries. histcontrol=ignoreboth # expand the history size histfilesize=10000 histsize=100 # commands with leading space do not get added to history histcontrol=ignorespace # am i on the internet? alias p4='ping 4.2.2.2 -c 4' # pwsafe alias pw='pwsafe -p' # ls aliases alias ll='ls -l' alias la='ls -a' alias l='ls -cf' alias lt='ls -laptr' #oldest first sort alias labc='ls -lap' #alphabetical sort # cd aliases alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' # cd into the old directory alias bd='cd "$oldpwd"' # install a package and automatically respond yes to confirmation prompt alias ins="sudo aptitude install" # remove a package and its configuration files alias remp="sudo aptitude purge" # search for a package - apt-cache and aptitude search in different ways # so have both alias searchc="apt-cache search" alias search="aptitude search" alias show="aptitude show"