You are not logged in.
BTW, i got a directory here that state : "drwxr-xr-t", what does it means and what is the octal value, if it exist, for that ?
If "t" is set on a directory, it means that files inside this directory can be renamed or removed only by the owner of the file, directory or the superuser. That's why /tmp always has "t" set.
I don't remember what "t" on a regular file does, it might have no effect at all. Thank god it's quite unimportant.
Keep in mind that "drwxr-xr-t" means "drwxr-xr-x" with sticky bit set. If the last "x" wasn't set, it would read "drwxr-xr-T".
Same goes for "s" (setuid/setgid) respectively "S".
The octal form to display the special access rights is:
1xxx for t
2xxx for setgid
4xxx for setuid
For example (very made-up):
3641 is rw-r-S--t
7654 is rwSr-sr-T
Offline
fk wrote:Why exists .bashrc and .bash_profile, when I only need one?
I think one of them is run only when logging in, while the other one is run every time bash is run.
Hooray for resurrecting dead threads! Yay!
.bash_profile is called only once, when you log in. .bashrc is called each time you spawn a new bash shell.
As a tidbit, many of you have said you have
source ~/.bashrc
in .bash_profile, or that you symlink the latter to the former.
To avoid errors, should .bashrc go missing, here's a minor modification:
if [ -f ~/.bashrc]; then
source ~/.bashrc
fi
- KD
Offline
More handy settings:
(More info at: http://forums.gentoo.org/viewtopic.php?t=112348)
# checks window size after command execution -> prevents wrapping problems after window resize
shopt -s checkwinsize
# autocorrects cd misspellings, eg. from 'cd /sur/src/linus', shell would correctly guess 'cd /usr/src/linux'
shopt -s cdspell
# wildcard includes dotfiles
# - this is handy since eg. 'chmod -r .* *' would include the directory itself, whereas
# now you can do 'chmod -r *' and all files and dotfiles will be chmodded, without the
# directory itself being affected
shopt -s dotglob
- KD
Offline
Got two of em:
Install packages from the AUR:
# Requires base-devel at latest version
alias inspkg=makepkg -sic
Stream YouTube videos to mplayer:
# Requires youtube-dl at the latest version
playYouTube(){
#If you would like to use a diffrent command-line-accesable media player simply replace 'mplayer' with your player and options of your choice eg. ffplay
mplayer $(youtube-dl -g -f 34 $1) # If you have a fast connection and would like to play youtube videos at full resoultion remove '-f 34' option from
# youtube-dl
}
Simple scripts I came up with myself
EDIT:
Added commenting, added the i and c option for makepkg : );
Last edited by Ahad12 (2013-08-11 23:43:14)
Offline
Instead of the first one, why not use 'makepkg -si'?
Offline
Instead of the first one, why not use 'makepkg -si'?
Cool, never noticed unitil now, and yes you can add the i option.
Offline
Hooray for resurrecting dead threads! Yay!
Oh, if only he could see the glorious 6-year necrobump that would follow his post.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
KomodoDave wrote:Hooray for resurrecting dead threads! Yay!
Oh, if only he could see the glorious 6-year necrobump that would follow his post.
Never even STARTED using linux till 2011...
Offline
Excuse the necrobump, found a function I quite enjoy e.o
conf() {
case $1 in
bspwm) vim ~/.config/bspwm/bspwmrc ;;
panel) vim ~/.config/bspwm/panel ;;
sxhkd) vim ~/.config/sxhkd/sxhkdrc ;;
baliases) vim ~/.bash_aliases ;;
xinit) vim ~/.xinitrc ;;
xresource) vim ~/.Xresources && xrdb ~/.Xresources ;;
bashrc) vim ~/.bashrc && source ~/.bashrc ;;
mpd) vim ~/.mpd/mpd.conf ;;
ncmpcpp) vim ~/.ncmpcpp/config ;;
esac
}
Don't really remember where I found it though, lost the bookmark. Somewhere on github I think...
Offline
This is more maintainable/flexible:
#!/usr/bin/env bash
# edit dotfiles
# heavy lifting by falconindy: https://bbs.archlinux.org/viewtopic.php?id=128585
dirs=($HOME/.$1* $HOME/.$1/ $XDG_CONFIG_HOME/$1/)
IFS=$'\n'
read -r -d '' -a files < \
<(find "${dirs[@]}" -type f \( \
-name "*.conf" \
-o -name "*.cfg" \
-o -name "*rc" \
-o -regextype posix-extended -regex '.*/conf(ig|ig[.][a-z]{2,3})?$' \
\) 2>/dev/null)
(( ${#files[*]} )) && "${EDITOR:-vi}" "${files}"
# vim:set sw=2 ts=2 et:
Offline
found a function I quite enjoy
This is more maintainable/flexible:
Maintainable for you, maybe... That's an intense piece of code!
I have my "HISTSIZE" and "HISTFILESIZE" variables set to something enormous, so editing a configuration file for me is done with "Ctrl-R, blargittyblarg.rc".
Offline
Why the read + array, wouldn't a find with "-exec $EDITOR '{}' \;" be sufficient?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Why the read + array, wouldn't a find with "-exec $EDITOR '{}' \;" be sufficient?
It would, for GNU find. I was vacilating between POSIX and bash when I first started this and seem to have alighted on the most complex implementation...
In its defence, it does work exceptionally well.
Offline