general sysadmin

untar unzip

$ tar -xzf file.tar.gz

env var

  • set up environment variable PICARD
  • so don’t need to call full path to PICARD library all the time
  • just use $PICARD
$ vim ~/.bash_profile
    export PICARD="/home/<username>/.../build/libs/"
$ source ~/.bash_profile
$ echo $PICARD
> /home/<username>/.../build/libs/

version

  • get linux version
$ cat /etc/*-release
or
$ lsb_release -a

disk space

$ df -k /some/dir/    # in numerics
$ df -h /some/dir/    # in human readable format

get dir size

dir1$ du -h          # human readable
dir1$ du -hs         # only size of dir1, no subdir

cd with breadcrumbs

$ cd dir1/
$ pushd dir2/
$ popd               # returns to dir1

pwd with real path

  • ignore symbolic links, prints full path
pwd -P

ls view dir file size in MB

ls -lah

EOF

Next