DEV Community

Jacopo Valanzano
Jacopo Valanzano

Posted on • Updated on

🐧 Linux - Nifty Shell Commands #3

Retrieve the original working directory of the current Unix shell session:

$ echo $( cd '$(dirname $0)' >/dev/null 2>&1 ; pwd -P )

Copy a file to clipboard:

$ xclip -sel c < /path/to/MyFileName

Clear system cache & swap:

$ sync; echo 3 > /proc/sys/vm/drop_caches
$ swapoff -a
$ swapon

Top comments (0)