Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Muppet Newbie terminal command questions

  • 22-04-2004 1:48pm
    #1
    Registered Users, Registered Users 2 Posts: 2,325 ✭✭✭


    Guys i've been searching the web looking for these commands but i cant find them so i'm hoping someone here can help.

    1) How do you display the PATH and ls -l commands in a more "user friendly" way? such as permissions and mod times etc

    2) How do i display a summary of disk usage for each diretory argument? I will figure out how to format in bytes KB and Mb myself. Also does that imply that the user must enter a diretory?

    And the most embarassing one of all.......

    3)What arguments of the who command only show those in your group?

    Cheers

    daz


Comments

  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    1) don't quite know what you mean.. if you mean a file explorer type interface, have a look at installing "midnight commander" .. otherwise pipe the output of ls to sort (ls -al |sort) and if you want to display the path then have a look at simply editing your prompt to include the current path (have a look in .bashrc .zshrc or .cshrc depending on what shell you are running)...

    2) du -k

    3) no idea offhand.. i cant recall any switch for w/who or finger that displays users groups.


  • Closed Accounts Posts: 484 ✭✭ssh


    You aren't by any chance in 2nd year CS in DIT, are you? :-)

    1)
    echo $PATH | sed 's/:/\
    /g' | while read line; do
    ls -plahd $line
    done

    2) du -h will tell you the usage of a directory, the -h makes the numbers more readable.

    3) they don't exist. You need to use groups command to find which groups you are in, one per line, preferably.

    then
    who | cut -d " " -f 1 |
    while read user; do
    groups $user | grep ${mygroup[0]}....
    done

    that won't work, coz it's incomplete, but that's the general idea.


  • Registered Users, Registered Users 2 Posts: 2,325 ✭✭✭Q_Ball


    hehe yeah. Its due in tomorrow and i have most of it done, backtitles turned out to be a piece of cake its just these last ones that i couldnt get


Advertisement