I've been working on my .bashrc file on and off for years. Over the years, I have searched through scores of others' .bashrc files and command prompts.
I think this is the most amazing and ultimate command prompt and .bashrc file I have ever seen, and I wanted to share it with anyone who wanted to use it.
I wanted this script to work on any machine running bash just "out of the box" without any needed modifications. And it's very friendly for new people coming to Linux.
To download it, simply go here:
http://mindnugget.com/bashrc/bashrc.tar.gz
Or, you can just execute this and reboot (backup your existing .bashrc file first if you need it):
Code:
/bin/rm -f ~/.bashrc* && cd ~ && wget http://mindnugget.com/bashrc/.bashrc && wget http://mindnugget.com/bashrc/.bashrc_help
Once installed, for
FULL COLOR HELP and description of each command and change, simply type:
Yes, it has it's own full color "help file" (using less supporting Page up and down - type Q to exit). No, I didn't make a man page for it and don't plan to. If you don't like the color, there is a non-color version included in the archive.
First, here's the command prompt:
Dark background:
Light background:
Solarized dark:
Solarized light:
Black and white:
It has a lot of useful information on it including the date, time, cpu usage, jobs, network connections to your machine, current user, server (if logged in SSH), your current directory, the size of all the files, the file count, and any errors with lookup text descriptions for those exit codes.
The ONLY feature this prompt does not contain (out of every prompt I've ever seen) is a timer for the last command executed. I did have the code working for this, but it requires debug, and it's just not very accurate. Also, it would stop working correctly if scripts gave weird exit codes. I removed it and may add it back in at some point.
Please note: The editor used in this script is nano, pico, or joe (it will automatically use what you have installed without any configuration). I use a graphical UI editor for most of my coding, so I have no need for the power of Emacs or even Vim. To change it, just change the alias and modify the edit function. If you install joe (available in almost all repositories and
Joe's Own Editor), the scripts will automatically use it immediately instead without any configuration or reboot. This script also uses multitail and tree for a couple of commands. To automatically install them on Mint, Ubuntu, Debian, Red Hat, Fedora, SuSE, Gentoo, or Mandriva, just type: install_bashrc_support
So what are some of the new lazy/helpful commands?
hlp - Show's a full color help file with these commands and other nice shortcuts
Configuration (These will find your configuration files for you! There is no need to modify the script.)
ebrc - Edit the .bashrc file
phpconfig - Edit the PHP configuration
apacheconfig - Edit Apache web server configuration
mysqlconfig - Edit MySQL database configuration
Searching
h - Search command line history (also CTRL-S and CTRL-R)
p - Search running processes
f - Search filenames in the current folder
ftext - Searches for text in all files in the current folder
Information
da - Show the date
ver - Show the current version of the operating system
checkcommand - Show if a command is aliased, a file, or a built-in command
cpu - Shows the CPU usage
topcpu - Show the top 10 CPU processes
logs - Show all logs in /var/log
apachelog - View Apache web server logs (requires multitail)
rot13 - Rot13 conversion
Folders
la - Directory listing: show hidden files
ls - Directory listing: add colors and file type extensions
lx - Directory listing: sort by extension
lk - Directory listing: sort by size
lc - Directory listing: sort by change time
lu - Directory listing: sort by access time
lr - Directory listing: recursive ls
lt - Directory listing: sort by date
lm - Directory listing: pipe through 'more'
lw - Directory listing: wide listing format
ll - Directory listing: long listing format
labc - Directory listing: alphabetical sort
lf - Directory listing: files only
ldir - Directory listing: directories only
.. - go back 1 folder
... - go back 2 folders
.... - go back 3 folders
..... - go back 4 folders
up - go up a specified number of folders
bd - change into your previous folder (also cd -)
cpp - Copy file with a progress bar
cpg - Copy and go to the directory
mvg - Move and go to the directory
mkdirg - Create and go to the directory
rmd - Remove a directory, all sub folders, and files
pwd - Show the current directory (not an alias)
oldpwd - Show the previous directory (not an alias)
pwdtail - Returns the last 2 fields of the working directory
countfiles - Count all files (recursively) in the current folder
diskspace - Show how disk space is being used
folders - Show subfolders and disk space
folderssort - Show subfolders sorted with disk space
tree - Show a folder and file tree
treed - Show a folder tree
mountedinfo - Show mounted information
home - go to your home folder
web - Change into your Apache web folder
File Permissions
000 - Change permissions to no read/write/execute
644 - Change permissions to read only/write for owner
666 - Change permissions to read only
755 - Change permissions to read only and execute/write for owner
777 - Change permissions to read, write, and execute
mx - make files executable
Archives
extract - Extract any archive(s) (does everything unp does without the need to install it)
mktar - Create a tar file
mkbz2 - Created a bzip2 archive file
mkgz - Create a gzip archive file
untar - Extract a tar file
unbz2 - Extract a bzip2 archive file
ungz - Extract a gzip archive file
Network
netinfo - Show current network information
whatsmyip - Internal and external IP address lookup
ipview - Show the number of connections to the web server
openports - Show open ports
Reboot
rebootsafe - reboot safely
rebootforce - force reboot
I really recommend adding bash completion to your system.
http://www.caliban.org/bash/index.shtml
Download and then copy the bash_completion/bash_completion file to /etc - the script will automatically pick it up if installed. You probably will want to make a /etc/bash_completion.d directory for any additional completion scripts.
If you have any comments or useful things you'd like to see added, let me know in the comments below.
Enjoy!