message when using find command parmeter -cmin or -mmin " FSUM6372 Unknown option "-cmin" " - unix

while trying to find the file in mainframe server which create last 10 minutes it shows error like
"FSUM6372 Unknown option "-cmin"
Usage: find directory ... expression"
it not accept the -mmin , -cmin , -amin this command
but i want to find the file which create last -10 minutes changed file
how to find it and anyone please help me on this case
find /input \( -name [0-9][0-9][0-9][0-9][0-9]_[A-Z][A-Z].dat \) -cmin -10
FSUM6372 Unknown option "-cmin"
Usage: find directory ... expression

You seem to not know what operating system you're running on, or anything about said operating system, which is concerning. You're running the command on z/OS V2R3, based on the output of uname. z/OS is POSIX compliant, and the options you're specifying on the find command aren't supported, as shown in the documentation.
I can think of two options: first, obtain a version of find that does support said options, or, second, use the tools present on the platform.
For the first option, you can obtain findutils, which includes find, from Rocket Software. Note that this requires an account with them, and may violate your site's security rules. It's also possible that this version is already installed; you should talk to your system programmer.
For the second option, find does have the –newer option, which looks for files created more recently than the specified file. You can use this in conjunction with the touch command's -t option, which will allow you to set a last modified date and time for a given file. So instead of -cmin -10, you would specify -t filename.

Related

need to find the path for my file (cygwin in Window7)

My apology for the "newbie trouble" that I created for myself & apology for my poor command of computer lingo
I am running a Windows 7 laptop and have a big text file (~4Gb) that I need to find certain string.
Most programs in Windows 7 cannot handle the task (file too big to open in any program in the Microsoft suite), so I downloaded cygwin and tried to grep the specific string.
The problem is
(a) the 4 Gb file is stored in the desktop of my non-admin account.
(b) I assume cygwin runs in the admin account (although I use the desktop cygwin icon to launch the environment). The reason being that under cygwin, I see the handle A#Admin-THINK (running it on a Lenovo Thinkpad laptop)
grep the file of interest results in "No such file or directory"
I tried to find the path of the file (readlink, realpath) but guess the commands were not applicable here?
Also tried /home/A/file or /home/A/desktop/file but it is clear that my random guess fails.
From windows, the file should be in
C:/Users/non_admin/desktop/folder/file
What would be the right path of the file to grep the string using cygwin ?
You can use /cygdrive to access the Windows filesystem. In your case, try
grep foo /cygdrive/c/Users/non_admin/Desktop/folder/file
From windows, you can get the correct file path from the context menu item Copy as path into the copy/paste buffer.
In Cygwin mintty, use
FilePath=<paste>
where <paste> means to use paste from mintty's context menu to make a variable with the value of that path.
Then use
grep <string> $(cygpath -u "$FilePath")
to search the file. The "'s are in case the file name contains spaces.
HTH

Trying to add R.exe to the PATH

So I tried adding R to the path on windows 10 (that is supposedly easy).
System Properties -> Environment variables -> Edit -> new: copy and paste: "C:\Program Files\R\R-3.5.0\bin\x64"
Now the thing is, Powershell just refuses to start the R environment when I type in R. R.exe works apparently. Rgui works as well. Is R a reserved letter in powershell or something? It also seems to repeat the previous command sometimes but that doesn't really seem completely consistent either.
(I put this entry on top of the list of the path and restarted the pc already)
when entering get-alias r I got the following result, so yes "r" is already taken ...
CommandType Name Version Source
----------- ---- ------- ------
Alias r -> Invoke-History
PS: you could remove that alias with remove-item alias:\r from your current powershell session and test if "r" then starts "R.exe". if that works for you, you could edit your profile to remove the alias "r -> Invoke-History" from every new session.
To generalize Guenther Schmitz' helpful answer:
PowerShell has several types of commands, whose precedence is:
Alias
Function
Cmdlet
External application
Note that name resolution is always case-insensitive, so that both r and R refer to the same command.
That is, before R resolves to R.exe, it is not only an r alias that could get in the way, but potentially also a function or a cmdlet (though the latter case is hypothetical, because well-behaved cmdlets follow a <Verb>-<Noun> naming pattern).
Note that built-in aliases shadowing external programs, especially standard ones, is problematic, and in the context of PowerShell Core a discussion is underway about whether to remove all built-in aliases and make them opt-in only - see this GitHub issue.
To see what a given name resolves to, use the Get-Command cmdlet:
# See what R resolves to
Get-Command R
# See ALL commands that R *can* resolve to, with the EFFECTIVE one listed first:
Get-Command -All R
Choices for unambiguously targeting R.exe:
(As you already know) If its folder is in one of the folders listed in environment variable $env:PATH, append .exe - i.e., use the filename extension explicitly:
R.exe ...
Use R.exe's full path (note the need for & for invocation, because the path needs quoting):
& "C:\Program Files\R\R-3.5.0\bin\x64\R.exe" ...
(For the sake of completeness; this is the cumbersome equivalent of using just R.exe): Use Get-Command -Type Application to locate the executable:
& (Get-Command -Type Application R) ...
Alternatively, as stated in Guenther's answer, you could add Remove-Alias r to your PowerShell $PROFILE file in order to remove the built-in alias on session startup, which then allows you to just use r to start R.exe.
Run the following code in your console to install the R package. This code will automatically add R to your os PATH.
sudo apt-get install littler

what is equivalent command of unix which in VMS

I have a tool xyz in vms.I want to get location where it is installed.For example in unix we can achieve this by using which command.So please help me vms equivalent of this command.
There is no equivalent command of which in VMS. To find the location of such a tool it depends on how the tool is set up on VMS. VMS commands can be DCL commands, aka DCL verbs, or foreign commands, aka DCL symbols. I assume you invoke the xyz tool with just typing "xyz" at the DCL command prompt.
DCL verbs are defined in a DCL command table. Your system administrator may have added the xyz tool to one of the DCL command tables, for example with the $ SET COMMAND command in the system wide LOGIN command procedure. If your tool is set up as a DCL command, you may want to get and look at the VERB utility (this utility is available from the VMS freeware CD), which will show you your XYZ command, with a DCl command $ VERB XYZ. Its output will list an "image" line, so anything after that keyword is the (file) specification of the tool's executable image. The default directory here is SYS$SYSTEM, which is a logical name. Keep in mind that the specification can be a (full) VMS file specification or just a logical name.
For foreign commands - almost always used for tools ported from Unix - you can check for the DCL symbol with the DCL command $ SHOW SYMBOL XYZ. If the tool is setup up this way, you will see an output like "XYZ == $file_ specification". Again, the file specification can be a (full) VMS file specification or just a logical name.
Additionally, recent versions of VMS support automatic foreign commands. That is, executable images (and command procedures), which are found in the directoy/-ies pointed to by the logical name DCL$PATH, will automatically be used as a foreign command. So your tool xyz may be a file in such a directory. This would be the easiest way to find its location: $ DIRECTORY DCL$PATH:XYZ should do it.
Since user2116290 has mentioned the freeware VERB utility I'll put in a plug for another freeware utility called DFU (for Disk/File Utilities).
One thing DFU can do is to search a disk volume's index file for all files matching a particular name. (It can also search by date, file size, file owner, and more).
DFU can do a lot of other useful things. Have a look at the website I linked to above for more information.
You can use....
$ PRODUCT SHOW HISTORY
the above command will help you to show installed products.
A hands-on way to locate the EXE-image. That's what I would do:
Ask your colleague or VMS admin
Check a foreign command, e.g. MYEXE (MYEXE :== $SOMEWHERE:[DIR]MYEXE.EXE):
SHOW SYMBOL/GLOBAL MYEXE
DIR 'f$string(MYEXE - "$")
Check a foreign batch command, e.g. MYCOM (MYCOM :== #SOMEWHERE:[DIR]MYCOM.COM):
DIR 'f$string(MYCOM - "#")
Check a defined DCL command verb, e.g. MYVERB (SET COM MYCOMMANDS.CLD) -- this one is the trickiest, depending on how .CLD file was processed), you may need a VERB utility (VMS freeware) to extract the details of the command verb from DCLTABLES.EXE
HELP MYVERB
HELP VERB
DIR SYS$SYSTEM:MYVERB.EXE
However, if you got to this point in your search, I would actually look through the LOGIN procedures, that's where such verb would potentially be set from a .CLD file ... unless the custom DCLTABLES where directly installed. So it is tricky and should be directed to the admin.
SEARCH SYS$LOGIN:LOGIN.COM MYVERB, "SET COM", ".CLD"
SEARCH SYS$MANAGER:SY*.COM MYVERB, "SET COM", ".CLD"
Still, the easiest is to ASK your colleague or your friendly VMS-admin... unless your are both of them :)

How to find out the location where a unix command executes from? [duplicate]

This question already has answers here:
How to find directory of some command?
(9 answers)
Closed 4 years ago.
Is there any way or command to find out the path from where the a standard command is executed from? Example ls, mkdir, mysql, hadoop, etc..
I know that their origin can be found out from $PATH variable, and should be probably in one of the /bin directories. But how can I get the directory correctly from where the command runs from?
The which command returns the full path of an executable, e.g.:
mureinik#comupter ~ $ which mkdir
/usr/bin/mkdir
and if you really need the directory, you could always apply dirname to it:
mureinik#conmputer ~ $ dirname `which mkdir`
/usr/bin
Reading the OP's question, I noticed the pointed exclusion of methods relying on PATH, and disregarded the obvious answer for which (because that is precisely what it does). The which program, by the way was originally a C-shell script although there are other implementations (FreeBSD, and bash for instance). Solaris, for instance, has a version little changed from 4.2BSD, and its manual page states
Both aliases and path are taken from the user's .cshrc file.
If you do not use C-shell, that original version of which has limited usefulness. Because there is no standard version, the results (and capability of the tool) can vary from system to system. Some shells (such as ksh) have similar features, but named differently, e.g., whence in the case of ksh (bash supplies the ksh alias type but not the `whence keyword).
I do not use which much, having better tools (conflict and path). But having ignored the obvious, the question as worded could easily pose a more interesting question: how can an application determine the directory from which another application was run. Not the obvious "where is the executable?", but "what was the working directory when the program was run?". There was a similar question recently dealing with relative pathnames.
On some of the systems which support the /proc pseudo-filesystem, there is a cwd node which gives the current working directory of a given process. The question Find out current working directory of a running process? goes into some detail regarding this.
xterm's optional feature "spawn-new-terminal" (added in patch #225 in 2007) uses this information to make a new terminal instance run in the same working directory as the user's current shell working directory.
A script could use this by starting with the process-id for the command in question, and inspecting the /proc tree for the corresponding cwd node.

p7zip / unzip case sensitivity - extracts archive to seperate folders

I am supplied data by a third party company in the form of self extracting EXE archives.
Take example:
fvdata.exe
When i extract this archive on my windows machine I get this(this is what I am trying to achieve):
fvdata_d
however on my CentOS 6.5 machine I get two folders:
fvdata_d FVdata_d
I believe the tech putting this archive together was a bit sloppy when it came to their case sensitivity. However I am not sure how to fix this.
Commands I have tried on the linux machine to extract:
7za x fvdata.exe -y -ssc-
unzip fvdata.exe -C
unzip fvdata.exe
If I can't do this maybe someone can reccommend a work around?
In unzip, the -LL option forces conversion of every filename to lowercase, regardless of the originating file system.
http://www.info-zip.org/mans/unzip.html

Resources