DBA Related commands:-
Finding files (find command)
Use the find command to recursively search the directory tree for each
specified Path, seeking
files that match a Boolean expression written using the terms given in the
following text.
The
output from the find command depends on the terms specified by the Expression parameter.
The following are examples of how to use the find command:
·
To list all files in the file system with the name .profile, type the following:
find / -name .profile
Below command need to find sonu file location.
bash-4.2$ find / -name
sonu 2>/dev/null
This
searches the entire file system and writes the complete path names of all files
named .profile. The slash (/) tells the find command
to search the /(root)
directory and all of its subdirectories.
To save time, limit the
search by specifying the directories where you think the files might be.
·
To list files having a specific permission code of 0600 in the current directory tree, type the following:
find . -perm 0600
This
lists the names of the files that have only owner-read
and owner-write permission. The dot (.) tells the find command to search the current directory and its subdirectories.
For an explanation of permission codes, see the chmod command.
·
To search several directories for files with certain permission
codes, type the following:
find manual clients
proposals -perm -0600
This
lists the names of the files that have owner-read and owner-write permission
and possibly other permissions. The manual, clients, and proposals directories and their subdirectories are searched. In the previous
example, -perm 0600 selects only files with permission codes that match 0600 exactly. In this example, -perm -0600 selects files with permission codes that allow the accesses
indicated by 0600 and other accesses above the 0600 level. This also matches the permission codes 0622 and 2744.
·
To list all files in the current directory that have been changed
during the current 24-hour period, type the following:
find . -ctime 1
·
To search for regular files with multiple links, type the
following:
find . -type f -links +1
This
lists the names of the ordinary files (-type f) that have more than one
link (-links +1).
Note: Every
directory has at least two links: the entry in its parent directory and its own .(dot) entry.
·
To search for all files that are exactly 414 bytes in length, type
the following:
find . -size 414c
How to check Mount Point
bash-3.2$ df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 5.00 2.63 48% 6665 2% /
/dev/hd2 5.00 0.66 87% 48058 24% /usr
/dev/hd9var 5.00 3.51 30% 18638 3% /var
/dev/hd3 5.00 4.19 17% 424 1% /tmp
AIX version
function aixversion {
OSLEVEL=$(oslevel -s)
AIXVERSION=$(echo "scale=1; $(echo $OSLEVEL | cut -d'-' -f1)/1000" | bc)
AIXTL=$(echo $OSLEVEL | cut -d'-' -f2 | bc)
AIXSP=$(echo $OSLEVEL | cut -d'-' -f3 | bc)
echo "AIX ${AIXVERSION} - Technology Level ${AIXTL} - Service Pack ${AIXSP}"
}
aixversion
Example output:
AIX 7.1 - Technology Level 3 - Service Pack 1
General Commands | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
No comments:
Post a Comment