alias Shorten Long Linux Command
Tired of typing Linux command because of long list of command option switches? Try to use the command alias to relieve tired of typing long Linux command then.
As the command name suggests, the Linux shell built-in command alias allows a user-defined command to represent
Related information:
find . -type d -print
This find command used with a long option switches to list all directories that exists from the current directory downwards. The find command could be rather long if more find command option switches applied.
This long command line could be made simple with an alias, such as
alias dirfind='find . -type d -print'
that allows user to execute the short user-defined command dirfind instead of typing out that long command line.
tar -zcvpf bin.tgz bin; [ $? -eq 0 ] && echo DONE || echo FAIL
These system commands execute sequentially, aim to check the tarball archive creation status upon its completion. If success then echo DONE else echo FAIL.
Again, by using the alias command could make it shorter and simple enough, such as
alias chkbkp='tar -zcvpf bin.tgz bin; [ $? -eq 0 ] && echo DONE || echo FAIL'
where the user could execute chkbkp at command prompt and the Linux shell will expanding it to that commands series.
To run a shell scripts in current shell environment instead of spawning into subshell, use one of these two syntax
source testscripts.sh
or
. testscripts.sh
This article has no comments yet. Why don't write your comments for this article?
So, feel free to write your comments for this article...