simple problem for a newbie


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting simple problem for a newbie
# 1  
Old 09-08-2011
simple problem for a newbie

I am trying to find a way to display just sudoers, passwd and shadow files without the extensions..

Thank you for any suggestions

Code:
 ls -lrt /etc | egrep 'sudoers|passwd|group|shadow'
-r--------    1 root     root         1338 Oct 31  2006 shadow.sav
-r--------    1 root     root         5191 Nov  1  2006 shadow.sav.061101
-r--------    1 root     root         1144 Nov  1  2006 shadow.gerry
-r--------    1 root     root        11099 Dec 11  2008 shadow.20081216
-r--------    1 root     root        11035 Dec 16  2008 shadow.20081217
-rw-r--r--    1 root     root         3282 Dec 22  2008 group.20081222
-r--r-----    1 root     root        12534 Feb 26  2010 sudoers.20100516
-rw-r--r--    1 root     root        15475 Mar 27  2010 passwd.20100516
-rw-r--r--    1 root     root         3792 Mar 27  2010 group.20100516
-r--------    1 root     root        12097 Apr 26  2010 shadow.20100516
-rw-------    1 root     root        11973 Nov 24  2010 shadow-
-rw-------    1 root     root        15325 Nov 24  2010 passwd-
-rw-------    1 root     root         3080 Nov 24  2010 gshadow-
-rw-------    1 root     root         3786 Nov 24  2010 group-
-r--r-----    1 root     root        12476 Nov 24  2010 sudoers.20110628
-rw-r--r--    1 root     root        15396 Nov 24  2010 passwd.20110628
-r--------    1 root     root         3091 Nov 24  2010 gshadow
-rw-r--r--    1 root     root         3808 Jan 13  2011 group.20110628
-r--------    1 root     root        12034 Jun 17 17:42 shadow.20110628
-rw-r--r--    1 root     root        15301 Jun 28 20:53 passwd
-rw-r--r--    1 root     root         3788 Jun 28 20:55 group
-r--r-----    1 root     root        12402 Jun 28 20:58 sudoers
-r--------    1 root     root        11967 Jul 22 16:59 shadow


Last edited by Scott; 09-08-2011 at 10:29 AM.. Reason: Please use code tags. Also, please use a more helpful subject.
# 2  
Old 09-08-2011
have your tried this?
Code:
ls -lrt /etc | egrep 'sudoers$|passwd$|group$|shadow$'

# 3  
Old 09-08-2011
Add $ to the end of file name and try..
Code:
ls -lrt /etc | egrep 'sudoers$|passwd$|group$|shadow$'

# 4  
Old 09-08-2011
Post deleted.

Last edited by clx; 09-08-2011 at 09:43 AM.. Reason: Solution already provided.
# 5  
Old 09-08-2011
Thank you ..

that did the trick !!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Newbie problem

Hi. I'm new to shell script and i have a problem My code ssh $i df -h|grep -ve Use | awk '{ if ( substr( $5, 1, length($5) - 1) > 80 ) echo -n "-----\n"$5" "$6 ; else echo -n "------\nOK!" }' | sort -uThe problem is : for example, if the %Use is ( 78;81 ), the scripts will print both "78"... (3 Replies)
Discussion started by: bobochacha29
3 Replies

2. UNIX for Dummies Questions & Answers

Need help with simple Linux commands - NEWBIE here!

Hey guys, I need help with simple unix commands. I'm a newbie to Unix and don't know these commands. Any help is appreciated. 1. Logon to Linux. 2. Create a directory "Unix" under your home directory. Command(s): …………………………………………. 3. Create four... (1 Reply)
Discussion started by: loverangerguy
1 Replies

3. HP-UX

Newbie: HP-UX installation problem

I recently bought myself a HP Visualize c3750 specifically to try out HP-UX (which I have never really used), I got it with a CD set of HP-UX 11 that I boot the machine from to install. I have no gfx adapter in the machine so I run an IBM InfoWindow II 3153 serial terminal attached to serial 1.... (4 Replies)
Discussion started by: dlundh
4 Replies

4. Shell Programming and Scripting

Newbie problem with simple script to create a directory

script is: dirname= "$(date +%b%d)_$(date +%H%M)" mkdir $dirname should create a directory named Nov4_ Instead I get the following returned: root@dchs-pint-001:/=>./test1 ./test1: Nov04_0736: not found. Usage: mkdir Directory ... root@dchs-pint-001:/=> TOO easy, but what am I... (2 Replies)
Discussion started by: gwfay
2 Replies

5. Programming

newbie to unix programming in C, needed a few simple prgs on these functions!

Hi all, I am a newbie to unix programming using C.. So i would like to have a few simple C programs to start off with.. I wanted programs on learning , abort,kill and raise,alarm and pause,I would also like to know how to use the vfork() in a prg It would be really great if i can have... (1 Reply)
Discussion started by: wrapster
1 Replies

6. UNIX for Dummies Questions & Answers

Simple newbie grep question

How come grep testfile1 won't find anything in testfile1 (even though the characters sd are there in great quantity), but grep '' testfile1 will find plenty? Do the single quotes prevent the shell from interpreting the testfile1 is interpreted as: grep *test whether or not characters sd exist*... (5 Replies)
Discussion started by: doubleminus
5 Replies

7. Programming

newbie problem

Im new to gcc, vim etc... and I've been trying a simple hello world program and every time I try to compile any C program I get the following error message test.c :1:19: error: stdio.h: No such file or directory test.c : In function 'main': test.c :5: warning: incompatible implicit... (5 Replies)
Discussion started by: blowFish@ubuntu
5 Replies

8. Shell Programming and Scripting

newbie problem

hi, I want to clarify this matter for a long time so here I come, I seen people use if ] or if or if (( some condition )) exactly what are the difference? Thanks! (2 Replies)
Discussion started by: mpang_
2 Replies

9. Shell Programming and Scripting

Newbie needs help with simple script

Hi, I'm just new here, looks like there is alot to read. I need some help on a simple script that i would like to make, and I honestly have zero experience with shell scripts or anything, so i have no idea what I am doing. I want to have a script that I can upload to to my webhosting... (12 Replies)
Discussion started by: shizizzle
12 Replies

10. UNIX for Dummies Questions & Answers

newbie problem please help

I am running a sun enterpirse 420 r with solaris 7 on it . I have a mount that is at 100 percent. It is running oracle on it., not sure version. i cant seen to find what is taking up all the space. is there a ls comand that will tell me the size of a directory and all sub folders in it. or... (2 Replies)
Discussion started by: Thump
2 Replies
Login or Register to Ask a Question