Sponsored Content
Top Forums Shell Programming and Scripting LS command does not list the correct file Post 302986270 by mohtashims on Wednesday 23rd of November 2016 07:42:38 AM
Old 11-23-2016
Linux LS command does not list the correct file

Hi,

I am logged into as root & inside the home directory of another user.

Code:
ls -a
[root@mymac user1]# ls -laq
total 44
drwx------   4 user1 adm 4096 Nov 23 05:10 .
drwxr-xr-x. 12 root     root   4096 Nov 22 13:05 ..
-rw-r--r--   1 user1 adm   18 Nov 22 13:05 .bash_logout
-rw-r--r--   1 user1 adm  193 Nov 22 13:05 .bash_profile
-rw-r--r--   1 user1 adm  231 Nov 22 13:05 .bashrc
drwxr-xr-x   3 user1 adm   17 Nov 22 13:05 .cache
drwxr-xr-x   3 user1 adm   17 Nov 22 13:05 .config
-rw-------   1 user1 adm   46 Nov 22 13:05 .k5login
-rw-r--r--   1 user1  adm  172 Nov 22 13:05 .kshrc
-rw-r--r--   1 root     root     18 Nov 23 05:10 .profile_new
-rw-------   1 user1 adm    8 Nov 23 07:36 .sh_history

Now when i say

Code:
ls -a "*profile*"
ls: cannot access *profile*: No such file or directory
ls -a *profile*
ls: cannot access *profile*: No such file or directory
ls -a *profile
ls: cannot access *profile: No such file or directory
ls -a profile
ls: cannot access profile: No such file or directory

I was expecting
Quote:
.bash_profile & .profile_new
to be displayed as an output to my ls command but none of the command yield any output.

Code:
uname -a
Linux mymac 3.10.0-327.36.1.el7.x86_64 #1 SMP Wed Aug 17 03:02:37 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Can you please suggest whats wrong ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Correct switches for xterm command to make font larger

Dear Sirs Whenever I bring up an xterm window on my laptop running Mandrivia Linux, the font in the xterm window is so small that it is practically unreadable ! What switches do I need to use with the xterm command xterm -?? in order to make the font larger ? (3 Replies)
Discussion started by: kanejm
3 Replies

2. UNIX for Dummies Questions & Answers

Is this grep command correct?

Hi I need to know if I have got the following grep command correct. I wanted to find from myfile.txt all signed real numbers (e.g. +5.0, -78, but not 5.0, 5 are not). I have thought about it and decided it was this: grep '' myfile.txt but I was wondering if this was correct. If... (2 Replies)
Discussion started by: rushhour
2 Replies

3. Shell Programming and Scripting

Check my script and correct the find command if wrong

Hello All, Here I am trying to find all the directories whose name starts with EFS or HOTFIX like in below example and below is my code but I don’t know why this is not working correctly. drwxr-xr-x 3 qabuild denccefs 4096 Sep 23 21:36 EFS110929A_SOURCE/ -rwxrwxr-x 1 qabuild... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

4. UNIX for Advanced & Expert Users

I was trying this command...am I going correct? other there is better way

I was trying to copy all debs from apt cache to some storage location and I was taking this approach... /var/cache/apt/archives# ls -1 | grep -v jdownloader | fgrep .deb | xargs cp /media/eshant/L-STORE/Softwares/openjdk/an error bla_bla.deb is a not directory stalled me Suggestions please... (9 Replies)
Discussion started by: ezee
9 Replies

5. SuSE

Is this iostat pipe to sort service request command correct?

Hi, my os is SLES 10 from sort iostat as my output does not include rkB/s and wkB/s I probably have to adjust the key position, so is the following iostat pipe to sort service request command correct? oracle@vmc_stallite:~> iostat -x | sort -nrk11 sda 0.96 ... (4 Replies)
Discussion started by: jediwannabe
4 Replies

6. Shell Programming and Scripting

Wget and correct zip for command

If there were 3 files put in a folder on /Desktop/Test then transferred to a site. would gzip -r /Desktop/Test zip them so that wget --http-user cmccabe --http -passwd xxxx*** https://something.sharefile.com/login.aspx -O - | tar -zxf - could be used to connect to the site, login,... (6 Replies)
Discussion started by: cmccabe
6 Replies

7. Shell Programming and Scripting

CUT command not giving correct result inside loop

Hi, i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues. Src file(jjj.txt) -------... (8 Replies)
Discussion started by: raju2016
8 Replies

8. Shell Programming and Scripting

How to auto correct a failing command?

If a command is not found, e.g. nawk, this is how I fix the problem ] && NAWK=/usr/bin/gawk ] && NAWK=/usr/bin/nawk ] && NAWK=/usr/bin/awkI use $NAWK an the set the appropriate value based on the system it runs. How can I implement a similar fix for a command found but illegal argument.... (6 Replies)
Discussion started by: mohtashims
6 Replies

9. OS X (Apple)

Can't figure out the correct syntax for a command loading a webkit plugin

Hello, Using Bash on Mac OS X 10.7.5 (Lion). I downloaded a GrowlSafari plugin for Webkit from its GitHub page GitHub - uasi/growl-safari-bridge: GrowlSafariBridge enables arbitrary javascript (including Safari Extensions) to notify via Growl.. In the description it says that after installing for... (0 Replies)
Discussion started by: scrutinizerix
0 Replies

10. Shell Programming and Scripting

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 Linux Server release 7.6 (Maipo) $ uname -a Linux server1 3.10.0-957.el7.x86_64 #1 SMP Thu Oct 4... (10 Replies)
Discussion started by: mohtashims
10 Replies
updmerge(8)						      System Manager's Manual						       updmerge(8)

NAME
updmerge - DO NOT USE THE updmerge UTILITY! SYNOPSIS
/usr/bin/updmerge [-r] directory /usr/bin/updmerge directory /usr/bin/updmerge file directory OPTIONS
Performs a recursive reinstallation of all the files and subdirectories in the /var/adm/install/update area relative to the specified directory. OPERANDS
Specifies the directory from which the reinstallation is relative, typically the root (/) directory. Specifies the name of a file in the update area, or specifies the relative pathname of that file from the update area. DESCRIPTION
Caution DO NOT USE THE updmerge UTILITY! The updmerge utility lets you merge files that have been preserved from a previous installation into a new installation environment. Any user file or customized file from a previous installation that you do not want replaced or overwritten can be saved and reintegrated into a new installation environment. You must have superuser privileges to invoke the updmerge utility, and the system must be in single-user mode. The updmerge utility must be invoked from the /var/adm/install/update directory, which is created by the updmv utility and contains entries for the files that have been preserved from the previous installation. Use the -r option followed by the directory operand to perform a recursive installation of all preserved subdirectories under the /var/adm/install/update area relative to a specific directory. Use the directory operand only to install only those preserved files directly under the /var/adm/install/update directory. This causes a non-recursive merge of the files in the specified directory. If you use the directory operand only, subdirectories in /var/adm/install/update are not merged into the new installation environment. Use the file operand followed by the directory operand to install a single preserved file. This file can be the name of the file in the /var/adm/install/update directory, or it can contain the relative pathname of that file from the /var/adm/install/update directory. If the file operand is a directory name instead of a file name, the updmerge utility reinstalls all files in that directory, but none in its subdirectories. To integrate files from the previous installation into the new installation environment, the updmerge utility compares each preserved file to the newly installed files with the following rules: If the preserved file does not exist on the system, you can view the preserved file before determining whether or not to install it. If the preserved file does exist on the system, you can view the differences between the preserved file and the newly installed file before selecting the file you want installed on the system. If a preserved file is identical to a newly installed file, a message is issued and the next file is checked. EXAMPLES
Recursively install all preserved subdirectories and files under /var/adm/install/update relative to the root (/) directory: updmerge -r / Install the preserved /etc/hosts file relative to the root (/) directory: updmerge etc/hosts / Install the preserved files in the etc directory relative to the root (/) directory (in this case, /etc): updmerge etc / RESTRICTIONS
Caution DO NOT USE THE updmerge UTILITY! You must have superuser privileges to invoke the updmerge utility. The system must be in single-user mode before you invoke the updmerge utility. The updmerge utility must be invoked from the /var/adm/install/update directory. FILES
Storage area created by the updmv utility. SEE ALSO
genufi(8), invsync(8), updmv(8), udetect(8), usync(8) stl_inv(4) updmerge(8)
All times are GMT -4. The time now is 09:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy