Posted: . At: 3:19 PM. This was 7 years ago. Post ID: 11394
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to create a bash alias that can take arguments.

This bash alias will take a directory name or path as an argument.

alias goto='cd $1'

This is an example of how this alias works.

jason@jason-desktop:~$ goto /usr/share
jason@jason-desktop:/usr/share$

This is a very neat bash trick. This might not work if the directory name uses spaces though.

Generate a very complex password with the Linux command line.

echo; head -5 /dev/urandom | tr -d -c '[:alnum:]' ; echo

Just read from /dev/urandom an filter out anything that is not a letter or number. This still creates a very secure password.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.