Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need more help with this i am not getting the right solutions. On the bottom, I

ID: 3850190 • Letter: N

Question

Need more help with this i am not getting the right solutions. On the bottom, I have include commands I found but are not working or not quite right

Note- I am using a non-gui red hat unix (Linux version 2.6.18-419.el5 (mockbuild@x86-027.build.eng.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-55)) #1 SMP Wed Feb 22 22:40:57 EST 2017)

4. From your home directory, find all the files associated with group 100. Copy/paste both your command and its output, but not its standard error output. My solution: 2 such files.

5. From your home directory, use egrep/cut/sort to produce a list showing the username and real name of all the students in the /etc/passwd file; the list should be lexicographically sorted by username. Copy/paste just your command for hand-in. My output:

023906973:Hobbs Ryan Thomas
10608634:Yang Zhiqiang
11159827:Chang Jonas
.
.
.
zrkerk:"Kerk Zi Rui" .
zsj25502:Zheng Jerod Shaojie
zuyanhuang:Huang Zuyan

note- I have tried

4.) find . -gid 100

find . -group admin

5.) $ cat /etc/passwd|cut -d':' -f3,1|sort -t':' -k1

cut -f 1,4 -d: /etc/passwd | sort

(and need solution to use egrep | cut | sort)

Explanation / Answer

4)
Can you check what are the gids available in your linux os using the "gid" command. For me also the command "find . -gid 100" will not work because there are no group id with 100. So check what are the gids available and try using the command.

Unix Terminal> gid
uid=2076059800(venkat) gid=1896053708 groups=1896053708,702(com.apple.sharepoint.group.1),12(everyone),62(netaccounts),80(admin),704(com.apple.sharepoint.group.2),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh)


Unix Terminal> find . -gid 1896053708 -ls|head
2678483        0 drwxr-xr-x   60 venkat            1896053708           2040 Jun 19 07:04 .
4115790        8 -rw-r--r--    1 venkat            1896053708             74 Jun 7 07:39 ./a
3983893       24 -rwxr-xr-x    1 venkat            1896053708           8908 Jun 2 23:18 ./a.out
4240774        8 -rw-r--r--    1 venkat            1896053708             11 Jun 9 14:59 ./abc
4115457        8 -rw-r--r--    1 venkat            1896053708             25 Jun 7 07:26 ./b
4284189        8 -rwxr-xr-x    1 venkat            1896053708            579 Jun 10 09:55 ./BhatiaLab31A.sh
4284422        8 -rwxr-xr-x    1 venkat            1896053708            666 Jun 10 10:09 ./BhatiaLab31B.sh
4283930        8 -rwxr-xr-x    1 venkat            1896053708            533 Jun 10 09:45 ./BhatiaLab32.sh
4284898        8 -rwxr-xr-x    1 venkat            1896053708            462 Jun 10 10:15 ./BhatiaLab33.sh
3486048        8 -rwxr-xr-x    1 venkat            1896053708            817 May 22 09:07 ./bigfiles.sh
Unix Terminal>

5)

The same command you have pasted is working for me. So i want to see the contents of your /etc/password file. Please share the contents so i can diagnose why there is a difference. Also mention what fields you are interested in /etc/passwd.
sh-4.3$ cat /etc/passwd|cut -d':' -f3,1|sort -t':' -k1                                                                               
adm:3                                                                                                                                
apache:48                                                                                                                            
bin:1                                                                                                                                
cg:1000                                                                                                                              
daemon:2                                                                                                                             
dbus:81                                                                                                                              
ftp:14                                                                                                                               
games:12                                                                                                                             
halt:7                                                                                                                               
lp:4                                                                                                                                 
mail:8                                                                                                                               
nobody:99                                                                                                                            
operator:11                                                                                                                          
root:0                                                                                                                               
shutdown:6                                                                                                                           
sync:5                                                                                                                               
systemd-bus-proxy:996                                                                                                                
systemd-network:998                                                                                                                  
systemd-resolve:997                                                                                                                  
systemd-timesync:999                                                                                                                 
sh-4.3$

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote