Thursday, February 28, 2019

How to Remove Files in Linux

 To remove (or delete) a file or directory in Linux from the command line, use the rm(remove) command.
Be extra careful when removing files or directories with the rm command, because once the file is deleted it cannot be recovered.
  • To delete a single file use, the rm command followed by the file name:
rm filename
Copy
If the file is write protected you will be prompted for confirmation as shown below. To remove the file type y and hit Enter. Otherwise, if the file is not write protected it will be deleted without prompting.
rm: remove write-protected regular empty file 'filename'?
Copy
  • To delete multiple files at once use the rm command followed by the file names separated by space.
rm filename1 filename2 filename3
Copy
You can also use a wildcard (*) and regular expansions to match multiple files. For example to remove all .pdf files in the current directory, use the following command:
rm *.pdf
Copy
When you use rm with wildcards (*) and regular expansions, it is recommended to list the files with the ls command so that you can see what files will be deleted before running the rm command.
  • Use the -i option to confirm each file before deleting it:
rm -i filename(s)
Copy
  • To remove files without prompting even if the files are write-protected use the -f(force) option:
rm -f filename(s)
Copy
  • You can also combine rm options. For example, to remove all .txt files in the current directory without a prompt in verbose mode, use the following command:
rm -fv *.txt
Copy

How to Remove Directories (Folders)

  • To remove an empty directory use the -d option.
rm -d dirname
Copy
  • To remove non-empty directories and all the files within them, use the r (recursive) option.
rm -r dirname
Copy
If a directory or a file within the directory is write-protected, you will be prompted to confirm the deletion.
  • To remove non-empty directories and all the files without being prompted use the r(recursive) and -f options.
rm -rf dirname
Copy
  • To remove multiple directories at once, use the rm command followed by the directory names separated by space.

rm -r dirname1 dirname2 dirname3
Copy
Same as with files you can also use a wildcard (*) and regular expansions to match multiple directories
Thanks - linuxize.com

Monday, January 7, 2019

HOW TO FIND/VIEW SYSADMIN PASSWORD – R12

CREATE OR REPLACE PACKAGE XXtest_GET_PWD AS
FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
RETURN VARCHAR2;
END XXtest_GET_PWD;
/

CREATE OR REPLACE PACKAGE BODY XXtest_GET_PWD AS
FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
RETURN VARCHAR2 AS
LANGUAGE JAVA NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt
(java.lang.String,java.lang.String) return java.lang.String';
END XXtest_GET_PWD;
/


SELECT Usr.User_Name,
Usr.Description,
XXtest_GET_PWD.Decrypt (
(SELECT (SELECT XXtest_GET_PWD.Decrypt (
Fnd_Web_Sec.Get_Guest_Username_Pwd,
Usertable.Encrypted_Foundation_Password)
FROM DUAL)
AS Apps_Password
FROM applsys.Fnd_User Usertable
WHERE Usertable.User_Name =
(SELECT SUBSTR (
Fnd_Web_Sec.Get_Guest_Username_Pwd,
1,
INSTR (Fnd_Web_Sec.Get_Guest_Username_Pwd,
'/')-1)
FROM DUAL)),
Usr.Encrypted_User_Password)
Password
FROM applsys.Fnd_User Usr
WHERE Usr.User_Name = 'SYSADMIN';

How To Change/Reset The Password For The SYSADMIN User

Through Backend
DECLARE
   l_flag   BOOLEAN;
 BEGIN
   l_flag := fnd_user_pkg.changepassword ('sysadmin', 'sysadmin');
  DBMS_OUTPUT.put_line (   'l_flag = '||CASE 
                               l_flag
                              WHEN TRUE
                                THEN 'true'
                              ELSE 'false'
                            END
                        );

 END;
 /



Through unixbox

Change the SYSADMIN password:


applmgr@[unixhost]-> FNDCPASS apps/PASS12011 0 Y system/PASS11445 USER SYSADMIN PASSs54lpRd