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’alias goto=’cd $1′ This is an example of how this alias works. jason@jason-desktop:~$ goto /usr/share jason@jason-desktop:/usr/share$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 … Read more

Get the command line of a process without the ps command.

To get the command line of a process without the ps command, and the PID of the command is known, use this command. This example is using a process with a PID of 28633. ubuntu ~ $ cat /proc/28633/cmdline ; echo upstart-socket-bridge–daemonubuntu ~ $ cat /proc/28633/cmdline ; echo upstart-socket-bridge–daemon This will show the command line … Read more