Thanks - there were some useful aliases in your latest article. You might like this function, which I find very useful when looking for permission errors:
lsdup() {
here=$(pwd)
while true
do
print "$(ls -ld) $PWD"
cd ..
[ $PWD = "/" ] && break
done
cd $here
}
by Sam Sexton (not verified) on 12/18/08 at 8:30 am |reply
moving to previous directory
To go back to the previous directory I just use "cd -". No special alias is required. But what if you're working amongst three directories? What's a good way to quickly set up shortcuts which allow to bounce between them?
by Anonymous (not verified) on 12/18/08 at 8:35 am |reply
aliases
You may not want to aliase rm -i as rm, especially if you use rm to remove files, etc using a script in cron, using the next choice would be better.
by Michael (not verified) on 12/18/08 at 8:38 am |reply
grep through code
Here's one I like to use, this one for Python applications, but easy to set up for other languages as well:
Beginning with the current directory, look for all of the Python files that are not part of subversion, not part of a bundle, skipping those that are like .py~ and .pyc, and pass those to grep.
by Anonymous (not verified) on 12/18/08 at 9:00 am |reply
Use of alias for rm -1
Regarding the comment on not aliasing rm to 'rm -i' due to its effect in scripts:
An alias shouldn't make any difference in scripts, as scripts should have hard paths for commands.
Scripts should contain something like this:
RM=/bin/rm
LS=/bin/ls
...
rm is then called in the script as $RM
There are at least 2 reasons for doing so:
* Your script will always run /bin/rm, not some script or executable named 'rm' that appears somewhere in your PATH
This is the same reason you probably don't want ./ in your path
* The PATH value becomes irrelevant to the running of frequently used commands in the script.
Personally, I use a function hardpath() that determines the location of each executable within a predetermined set of directories, and sets the requisite variable to that location. The script fails if a required executable is not found in the path set.
by Jared (not verified) on 12/19/08 at 10:04 am |reply
CD between 3 directories quickly
THE CODE:
cdA()
{
A_old_dir=$PWD
[ ! -z $* ] && A_new_dir=$*
cd $A_new_dir
}
cdB()
{
B_old_dir=$PWD
[ ! -z $* ] && B_new_dir=$*
cd $B_new_dir
}
cdC()
{
C_old_dir=$PWD
[ ! -z $* ] && C_new_dir=$*
cd $C_new_dir
}
alias ,a=cdA
alias ,b=cdB
alias ,c=cdC
# I use a comma as a shortcut to 'cd'
# Both begin with a comma.
# Now ,a is easier than cdA
# Your choice, name them anything.
# try these
,a /usr/local/bin # puts you in specified directory
,b /var/adm
,c /usr/bin
# now use just the alias (no directory)
,a # puts you in /usr/local/bin
,c # puts you in /var/adm
,c # puts you in /usr/bin
# and my two favorite cd-related shortcuts
alias ,=cd # cd to a directory
alias ,,='cd -' # cd back to the previous directory
# I picked parts of these up over the years doing
# UNIX support. I've tweaked them and made them
# do what I've needed. Have fun.
by Brian~R (not verified) on 12/23/08 at 1:31 pm |reply
typos - CD between 3 directories quickly
I meant to say that 'cd' and comma both begin with a 'c', that's how I remember it.
Also, in the 'now use just the alias' section, the second one should be ,b (not ,c).
Ciao
by Brian~R (not verified) on 12/23/08 at 1:36 pm |reply
by Anonymous (not verified) on 9/18/09 at 4:22 pm |reply
replica bags
If I didn't read this artcle ,I wounldn't believe these things replica bags happened in the world . Why people are always replica handbags so stoniess to others ? Man are really stupy creature.
by replica handbags (not verified) on 10/24/09 at 3:19 am |reply
Sidekick: The Good News & the Bad News Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325
Surviving Windows is easier than you think… MKS offers the power of an integrated all-in-one environment and provides you with the Power of UNIX on Windows Learn More
Brought to you by:
Free books
We have 5 copies of these two new books to give to some lucky readers. The deadline for entries is November 30, 2009.
AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.
In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases
built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC
technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability
and performance at a fraction of traditional cost.
On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.
Aliases etc.
Thanks - there were some useful aliases in your latest article. You might like this function, which I find very useful when looking for permission errors:lsdup() {
here=$(pwd)
while true
do
print "$(ls -ld) $PWD"
cd ..
[ $PWD = "/" ] && break
done
cd $here
}
moving to previous directory
To go back to the previous directory I just use "cd -". No special alias is required. But what if you're working amongst three directories? What's a good way to quickly set up shortcuts which allow to bounce between them?aliases
You may not want to aliase rm -i as rm, especially if you use rm to remove files, etc using a script in cron, using the next choice would be better.grep through code
Here's one I like to use, this one for Python applications, but easy to set up for other languages as well:alias greppy="find . | grep -v [.]svn | grep -v bundle | grep [.]py$ | xargs grep "Beginning with the current directory, look for all of the Python files that are not part of subversion, not part of a bundle, skipping those that are like .py~ and .pyc, and pass those to grep.
Use of alias for rm -1
Regarding the comment on not aliasing rm to 'rm -i' due to its effect in scripts:An alias shouldn't make any difference in scripts, as scripts should have hard paths for commands.
Scripts should contain something like this:
RM=/bin/rm
LS=/bin/ls
...
rm is then called in the script as $RM
There are at least 2 reasons for doing so:
* Your script will always run /bin/rm, not some script or executable named 'rm' that appears somewhere in your PATH
This is the same reason you probably don't want ./ in your path
* The PATH value becomes irrelevant to the running of frequently used commands in the script.
Personally, I use a function hardpath() that determines the location of each executable within a predetermined set of directories, and sets the requisite variable to that location. The script fails if a required executable is not found in the path set.
CD between 3 directories quickly
THE CODE:cdA()
{
A_old_dir=$PWD
[ ! -z $* ] && A_new_dir=$*
cd $A_new_dir
}
cdB()
{
B_old_dir=$PWD
[ ! -z $* ] && B_new_dir=$*
cd $B_new_dir
}
cdC()
{
C_old_dir=$PWD
[ ! -z $* ] && C_new_dir=$*
cd $C_new_dir
}
alias ,a=cdA
alias ,b=cdB
alias ,c=cdC
# I use a comma as a shortcut to 'cd'
# Both begin with a comma.
# Now ,a is easier than cdA
# Your choice, name them anything.
# try these
,a /usr/local/bin # puts you in specified directory
,b /var/adm
,c /usr/bin
# now use just the alias (no directory)
,a # puts you in /usr/local/bin
,c # puts you in /var/adm
,c # puts you in /usr/bin
# and my two favorite cd-related shortcuts
alias ,=cd # cd to a directory
alias ,,='cd -' # cd back to the previous directory
# I picked parts of these up over the years doing
# UNIX support. I've tweaked them and made them
# do what I've needed. Have fun.
typos - CD between 3 directories quickly
I meant to say that 'cd' and comma both begin with a 'c', that's how I remember it.Also, in the 'now use just the alias' section, the second one should be ,b (not ,c).
Ciao
Unix alias
Some more information about unix alias commandreplica bags
If I didn't read this artcle ,I wounldn't believe these things replica bags happened in the world . Why people are always replica handbags so stoniess to others ? Man are really stupy creature.