Search Results

Search: Posts Made By: mohtashims
199
Posted By mohtashims
But you have not considered the file size. Can...
But you have not considered the file size. Can you please include that in your answer?

Also note that the files should be searched recursively under subfolders.
199
Posted By mohtashims
Increase the performance of find command.
I'm trying to exclude 'BACKUP', 'STORE', 'LOGGER' folders while searching for all files under a directory "/tmp/moht"

Once a file is found I wish to display the filename, the size of the file &...
152
Posted By mohtashims
Unable to grep using wildcard in a file.
I wish to check if my file has a line that does not start with '#' and has
1. Listen and 2. 443

echo "Listen 443" > test.out

grep 'Listen *443' test.out | grep -v '#'
Listen ...
346
Posted By mohtashims
Will updating the "id utility" to the latest...
Will updating the "id utility" to the latest version on the old 6.1 linux help ?
346
Posted By mohtashims
In which case what would be the best approach...
In which case what would be the best approach towards getting the username given the pid ?
346
Posted By mohtashims
If so, how can i get the user id of a running...
If so, how can i get the user id of a running process that works on all OS types ? Below is what i have been using so far:

Id -nu `cat \proc\pid\loginuid`
346
Posted By mohtashims
Id command does not return correct username
On server1 the "id" command works fine and returns "myuser" user as was expected. Below are the details of the good server.
$ id -nu 501
myuser

$ cat /etc/system-release
Red Hat Enterprise...
341
Posted By mohtashims
The path and the hostname both may be either...
The path and the hostname both may be either upper or lower and we are not certain of that

In such a case how will my ls command to the file still work whether a lower or upper case is...
341
Posted By mohtashims
I understand the above solution would work on any...
I understand the above solution would work on any AiX or non-Aix L/Unix system.

The blow PATH exists on my SYSTEM
/app/weblogic/myserver4/logs/MYHOSTTSTAPP1Cell044Data/data/proc.pid

i tried...
341
Posted By mohtashims
How to figure out a if insensitive file path exists or not?
I use the below command with echo $? to determine if a file path exists.

ls /app/weblogic/myserver4/logs/`hostname`/data/proc.pid
Output:
...
Forum: Shell Programming and Scripting 2 Weeks Ago
942
Posted By mohtashims
Unfortunately this does not work for me Centos 7...
Unfortunately this does not work for me Centos 7 Redhat Linux. I get the below error:

$ find . -name '*.jar' -exec jar tf {} \; | grep -v '/$' | xargs grep -hil...
Forum: Shell Programming and Scripting 2 Weeks Ago
942
Posted By mohtashims
Works !! Is it possible to print the jar file...
Works !! Is it possible to print the jar file name incase i grep for the output like below:

find . -name '*.jar' -printf "%f%h" -exec jar tvf {} \; | grep -i 'org/openqa/selenium/WebDriver'
...
Forum: Shell Programming and Scripting 2 Weeks Ago
942
Posted By mohtashims
View all jar files contents in one go ?
I can view a jar file contents using the below command:

$ jar -tvf ./checker-compat-qual-2.0.0.jar
0 Mon May 02 18:28:46 IST 2016 META-INF/
184 Mon May 02 18:28:44 IST 2016...
Forum: Shell Programming and Scripting 2 Weeks Ago
718
Posted By mohtashims
stat file does not exists on AiX. There is a file...
stat file does not exists on AiX. There is a file called status but it is seems encrypted.

See below:

ls -ltr /proc/15598024/stat
/proc/15598024/stat not found
$>ls -ltr /proc/15598024/stat...
Forum: Shell Programming and Scripting 2 Weeks Ago
718
Posted By mohtashims
Do we have generic solution get process start time in AIX & Linux
I wish to get the process start time on AiX and Linux using the same command / script.

I'm able to get the process start time in Linux using the below command:

cat /proc/<pid>/stat | grep...
Forum: Shell Programming and Scripting 3 Weeks Ago
1,006
Posted By mohtashims
@RudiC, Thank you for the answer. It worked !!
@RudiC, Thank you for the answer. It worked !!
Forum: Shell Programming and Scripting 3 Weeks Ago
1,006
Posted By mohtashims
Delete all files of a particular name & extension except one file.
I wish to delete all files that starts with "body<any number of digits>.xml" except body65.xml on Linux 7 bash shell

So, from the below files

body64.xml
body.sh
body65.xml
body655.xml...
595
Posted By mohtashims
But, my requirement is to add only after the...
But, my requirement is to add only after the first occurance. A non sed solution will do.
595
Posted By mohtashims
Insert text after the first occurance of searched string entry in a file
My server xml file has huge data part of which i'm sharing below.



I wish to add the below text held by variable "addthisline" after the closing braces i.e --> once the first </Connector>...
2,002
Posted By mohtashims
Thank you .... Works Perfect @Corona @RudiC.
Thank you .... Works Perfect @Corona @RudiC.
2,002
Posted By mohtashims
@Rudic thank you for the inputs. How can we...
@Rudic thank you for the inputs. How can we assign the passed array to a variable in the function. I ask this becoz i did not get a chance to go back to my system and try out how to do that.
2,002
Posted By mohtashims
How to pass and read an array in ksh shell script function.?
I'm able to read & print an array in varaible called "filelist"

I need to pass this array variable to a function called verify() and then read and loop through the passed array inside the...
1,742
Posted By mohtashims
Resolved the issue by this logic VAR1=`echo...
Resolved the issue by this logic

VAR1=`echo "${1}" | sed -e "s/'//g"`
echo "${VAR1}" |
while IFS=' '
read -r dirpath
do
if [ $tmp -le 1 ]; then
fileis=`echo "$dirpath" | awk -F'...
1,742
Posted By mohtashims
Need to filter string between specific string in ksh
My argument has data as below.

10.9.9.85
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr56scr 127869538...
1,942
Posted By mohtashims
Any other solution please ? As the arguments are...
Any other solution please ? As the arguments are constructed by variable substituted values constructed at runtime.

Considering I have root privileges , can I modify this setting somewhere ?
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy