background preloader

Shell

Facebook Twitter

Shell startup scripts — flowblok’s blog. If you’re a regular shell user, you’ve almost certainly got a .bash_profile or .bashrc script in your home folder, which usually contains various tweaks, such as setting environment variables (adding that directory to $PATH), telling your shell to do clever things (like set -o noclobber) and adding various aliases to commands (like alias please=sudo).

Shell startup scripts — flowblok’s blog

(If you’re really organised, you’ll have all your dotfiles in a repository somewhere so that you can keep your settings synchronised across all the machines you work on.) Anyhow, I suspect that few people know when things like .bash_profile and .bashrc actually get executed. When I started, I just followed people’s advice of putting stuff in .bashrc, and then when it didn’t work, into .bash_profile. My solution to this problem is to define some new dotfile folders, one for each shell (.bash/, .zsh/ and .sh/), and one for the shell-independent files (.shell/): “But!” Where to put stuff It all depends on when it needs to be run. Implementation. 7 Linux Shell Tips For Increased Productivity. Love it or hate it, the command line is here to stay.

7 Linux Shell Tips For Increased Productivity

Sure, there are new options emerging like TermKit but it’s unlikely that the command line will ever really go away. Those who take the time to master it can run productivity circles around their peers, but with the astonishing assortment of CLI tools available, where do you even begin? We’ve compiled a few of the most useful tools and tricks into this guide to help new users gain some new knowledge, and old pros learn some new tricks. Note: Some of the tools or commands listed here may require root privileges. There are several reasons to make a temporary RAM-based filesystem such as fast read/write times or to guarantee that the files will not persist after reboot. Where /mytemppartion is the location you wish to mount (it must already exist) and 1024m is the desired size of the ramdisk. Linux pros almost certainly know the at command, it lets you set a specific time for a job to be run. To see just such a list.

Bash Hackers Wiki Frontpage. All commands. Crazy POWERFUL Bash Prompt. From setting the window title to show the last run command (filtered), saving your history and keeping multi-session history intact, resetting the color/cursor/highlighting of errant color-emitting commands, these 2 prompt examples do more than meet the eye and are extremely fast.

Crazy POWERFUL Bash Prompt

Don't have much time or just don't care? No problem, this is a simple copy and paste... here's one to start (all 1 line, just cut and paste right into the shell, once you've made sure its safe). Basic POWER PROMPT ^ PROMPT_COMMAND='history -a;echo -en "\033[m\033[38;5;2m"$(( `sed -n "s/MemFree:[\t ]\+\([0-9]\+\) kB/\1/p" /proc/meminfo`/1024))"\033[38;5;22m/"$((`sed -n "s/MemTotal:[\t ]\+\([0-9]\+\) kB/\1/Ip" /proc/meminfo`/1024 ))MB"\t\033[m\033[38;5;55m$(< /proc/loadavg)\033[m"' \ PS1='\[\e[m\n\e[1;30m\][$$:$PPID \j:\!

\[\e[1;30m\]]\[\e[0;36m\] \T \d \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]:\[\e[0;37m\]${SSH_TTY} \[\e[0;32m\]+${SHLVL}\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n($SHLVL:\!) Extreme Power Prompt ^