Snippets
Created by
Aaron Bartell
last modified
Common PASE Commands
Find
Look for a file named file.txt
starting in the current directory.
find . -name file.txt
Look for files with the word 'Error' in them. First get a list of files in the current directory, pipe the results to xargs and in turn grep, and grep will search the results for "Error" in case-insensitive fashion.
find . -type f | xargs grep -i "Error"
Misc
Does a program/command exist?
$ which git
/QOpenSys/usr/bin/git
Check to see where the symbolic link points to so you know which version/implementation of a program is being run. This is especially useful for things like git
because it has been delivered by PowerRuby, perzl, and now IBM. The below combines which
with ls
to find the destination.
$ which git | xargs ls -al
lrwxrwxrwx 1 qsys 0 82 Dec 15 2016 /QOpenSys/usr/bin/git -> /QOpenSys/QIBM/ProdData/OPS/tools/bin/git
Find version of IBM i OS. The below declares it is 7.3.
$ uname -vr
3 7
Comments (0)
You can clone a snippet to your computer for local editing. Learn more.